Quite.. I realized there inumerable ways for you to break code that returns in this way (e.g. if testA was storing a reference to another temporary object on the stack). But that wasn't point of...
Type: Posts; User: griffin2000
Quite.. I realized there inumerable ways for you to break code that returns in this way (e.g. if testA was storing a reference to another temporary object on the stack). But that wasn't point of...
They don't... But then I don't have any proof to the contrary :-) I've alway ASSUMED that this was safe (that compiler was gauranted to copy the returned variable before the stack was popped), and...
Is it always safe to return temporary stack variables from a function as long as you don't return a reference or a pointer ? So is this always gauranteed to be safe, on all...
When I make this mistake in C programming:
void myF(); //Extra semi colon here
{
printf("hello");
}
I get this error in MSVC: