A classmate had a function like this :
char* Func( int a )
{
if( a == 0 )
return "yes";
else
return "no";
}
I know that return a local char* is undefined, but when I asked him he said that since "yes" and "no" wasn't declared as variable it was not undefined behavior.
Who is right? And why?