I have the following code:
const char * func_journey ()
{
const char * manner = "Hello";
manner = "World";
return manner;
}
int main()
{
const char * Temp;
Temp = func_journey();
return 0;
}
I ran it in debug just to see what happens, somehow manner changed from "Hello" to "World" and also the pointer changed even due I have declared it a const.
Another thing is that at the end of the run Temp was "World", now how can it be? manner was an automate variable inside func_journey, shouldn't it get destroyed at the end?
Thanks a lot.