Hi Everyone,
I have the following function,
char* sample1()
{
char *p = "Israel";
return(p);
}
//in this case the memory storing india is not destroyed at the end
of the function, indicating that it wasn't stored in the stack meant
for the function call.
However, the following function causes unexpected behavior as
expected ;-)
char* sample2()
{
char p[] = "Israel";
return(p);
}
Is it because that the value that in the address that returned by sample2 is still the same i mean its not magicly reseted to zero?