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

mysql - FireDac error 314 - but DLLs are in program directory -

python - ValueError: could not convert string to float -

php - Laravel Get all child node count with condition -