where is the string literal allocated ? On the stack ?

Michael Gong mwgong@cs.utoronto.ca
Fri Apr 20 15:36:00 GMT 2007


Hi,

Though it's not related with gcc, could anyone help me with following 
question:

Where is the string literal allocated ? Is it on the stack ?

For example, where is "abc" allocated ?

char * foo() {
    return "abc";
}


Thanks.

Mike






More information about the Gcc-help mailing list