How is printf statement interpreted?

后端 未结 5 1254
耶瑟儿~
耶瑟儿~ 2020-12-06 11:39

How is the following line interpreted by GCC compiler:

printf(\"HELLO\");  

I want to know this because when I am running following program

5条回答
  •  悲哀的现实
    2020-12-06 12:32

    Is is the same as writing

    char *ptr="Good Morning";
    

    followed by

    printf( ptr + 5 );
    

    which is &ptr[5] this adress points to "Morning";

    Adding an integer n to a pointer results to an adress ptr + n * sizeof(type)

提交回复
热议问题