C language
puts() 사용법 (puts() usage)
cheay
2017. 7. 31. 22:06
SMALL
아래를 보고 puts() 함수는 주소를 전달받는다는것을 알수있다. 포인터처럼 +4 와같은 연산으로도 사용이 가능하다.
#include <stdio.h>
#define DEF "I'm a string defined by #define" int main(void) { char str1[80] = "An array was initialized to me."; const char * str2 = "A pointer was initialized to me."; puts("I am a parameter passed to puts(). "); puts(DEF); puts(str1); puts(str2); puts(&str1[5]); puts(str2+4); return 0; }
BIG