char * function decode time()
{
tm *ptm; //time structure
static char timeString[STRLEN]; //hold string from asctime()
ptm = gmtime( (const time_t *)<ime ); //fill in time structure with ltime
if(ptm)
{
strncpy(timeString, asctime( ptm ), sizeof(timeString) );
//EDIT
sprintf(test, "Sting is: %s", timeString);
return timeString;
.
.
} //end function
When I step through the code in the debugger I I can see the value of timeString is:
timeString CXX0017: Error: symbol "timeString" not found
However, when I remove the work "static" from timeString it does fill in correctly with the string but is now a local copy and will be destroyed.
Why am I not able to copy the string from this function into a static char array?
Visual Studio 6.0 - MFC
Thanks.
EDIT the "test" string does contain the value of timeString.
I guess this is just a debugger issue? but why can't I see the value of a static array in the debugger watch?