A
Abubakar
Hi,
its a c++ question. If I have the following code:
TCHAR * getsomestring()
{
TCHAR buff[2000];
// here I copy something in the buffer using wcscpy.
return buff;
}
Is this a valid code? I mean I see it as a buff allocated on the stack which
should be destroyed on the return of the function but I return it and some
other code will still have a pointer to it and try to read it. It works fine
but I wanted to clear the concept.
Thanks,
-Ab.
its a c++ question. If I have the following code:
TCHAR * getsomestring()
{
TCHAR buff[2000];
// here I copy something in the buffer using wcscpy.
return buff;
}
Is this a valid code? I mean I see it as a buff allocated on the stack which
should be destroyed on the return of the function but I return it and some
other code will still have a pointer to it and try to read it. It works fine
but I wanted to clear the concept.
Thanks,
-Ab.