Hi,
I have the following code:
First question: Is the string "Blah" stored on stack? If so, how come it can be printed in main()? Shouldn't it be removed off the stack right upon exiting function returnString()?Code:#include <stdio.h> char * returnString () { char *string; string = "Blah"; return (string); } int main() { printf("%s\n", returnString()); return (0); }
Second question: After compiling this code, my compiler gives me the following warning:
Could you tell me why?Call to function 'returnString' with no prototype in function main
Thanks a lot, guys.