Possible Duplicate:
Is returning a string literal address from a function safe and portable?
“life-time” of string literal in C
Hello i am confused somewhat
char *func()
{
return "Hello";
}
Here "Hello" is sequence/array of characters. It is a local variable and it must vanish away as soon as the function returns. Then how come we are able to get the correct value?