Untitled
public cpp v1 · immutablechar *date() { time_t rawtime; struct tm * timeinfo; char buffer [128]; time( &rawtime ); timeinfo = localtime( &rawtime ); strftime(buffer, 128, "%a %b %d %X %Z %Y", timeinfo); // Now here is the warning (and error) puts( buffer ); // Sun Sep 20 21:56:21 CEST 2009 return buffer; // Some garbled stuff :(}// This is the output:// 00000000 f0 d0 98 bf 01 00 00 00 1d 00 00 00 e0 74 e3 b7 |.............t..|// 00000010 f0 d0 98 bf f4 5f f5 b7 58 d1 98 bf 6a 0a |....._..X...j.|