Questions...???

  • Thread starter Thread starter mujeebrm
  • Start date Start date
M

mujeebrm

Hi,

my name is mujeeb.

i have some questions about below mentioned program...

main(){ char *c="main(){char *c=%c%s%c;printf(c,34,c,34);}"
printf((c,34,c,34);}

*c is pointer to char sing-dim array

34 is ascii for " quotes "

then how printf(c,34,c,34); prints the whole program as it is or replicates
it when

printf's declaration says that

printf(format specifiers, arg list);

but in this statement we are only doing this printf(c,34,c,34); why

can any plz decipher this to me or provide reasons or techniques behind all
this...


i would really appreciate it.

thanx,

mujeeb.
 
then how printf(c,34,c,34); prints the whole program as it is or replicates

The first c is the format specifier, the first 34 fills up the first %c, the
second c fills up the %s and the second 34 fills up the second %c [sorry
about the crude language usage].
 
Back
Top