hello,
hopefully someone out there can help me with this. I'm using ctime to print a time_t value in a more friendly format, but when ctime is called more than once with different values, it prints the same time. here's a small piece of the code, and the output.
Code:
cout << ctime (&(statBuff->st_atime))
<< ctime (&(statBuff->st_mtime))
<< ctime (&(statBuff->st_ctime)) << endl;
output example:
Thu Sep 26 13:38:54 2002
Thu Sep 26 13:38:54 2002
Thu Sep 26 13:38:54 2002
More info....statBuff is a 'struct stat' type, and yes, i did check the members st_atime, st_mtime, st_ctime. they all hold different values so ctime should print a different string for each one.
I really don't see what i'm doing wrong. i'm really thinking it has something to do with the way ctime is implemented. Do anyone know for sure?
gcc 2.96 (Mandrake's version...I don't have a choice on this one)...