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

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -