I could not understand how the below program code outputs that value.Please help me to understand.
#include<stdio.h>
char*s="char*s=%c%s%c;main(){printf(s,34,s,34);}";
int main()
{
printf(s,34,s,34);
return 0;
}
output:
char*s="char*s=%c%s%c;main(){printf(s,34,s,34);}";main(){printf(s,34,s,34);}
Your
printfstatement is effectively equivalent to:I’ve marked the conversion specifiers with
^. These get replaced with, respectively:"– the ASCII character corresponding to 34*s"– the ASCII character corresponding to 34