Code:#include<stdio.h> void print(char *p) { if(*p) print(++p); printf("%s\n",p); } main() { char *p="ABCD"; print(p); }
for the above program I'm expecting output as
but the ACTUAL output isCode:(null) D CD BCD
Why printf is printing two NULL?Code:(null) (null) D CD BCD