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 -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -