Reason for the Output

后端 未结 6 1500
醉话见心
醉话见心 2021-01-13 12:36
#include
int main(void)
{
 int a=5;
 printf(\"%d\"+1,a);
}

Output: d. I didn\'t get how the output is coming: d ?

6条回答
  •  渐次进展
    2021-01-13 12:56

    Suppose you had:

    char x[] = "%d";
    

    What do you expect

    printf(x + 1, a);
    

    to print?

    Hint: t.c:5: warning: too many arguments for format

提交回复
热议问题