c - Why the output of printf("%d" +1) is d but printf("%%%d"+1) is %d? -
why output of
#include<stdio.h> void main() { printf("%d"+1); }
is d output of
#include<stdio.h> void main() { printf("%%%d"+1); }
is %d , not %%d ??
"%d"+1
pointer arithmetic takes second char in char array d
.
in string literal "%%%d"+1
leaves "%%d"
interpreted %d
printf
. since %%
escaped %
.
Comments
Post a Comment