At first glance the code seems quite simple and straightforward:
test.c:
And I expect the output to be:Code:#include <stdio.h> #include <time.h> int main(void) { time_t t_0 = 1238011200; time_t t_1 = 1255348800; printf("%s", ctime(&t_0)); printf("%s", ctime(&t_1)); printf("Again\n"); printf("%s%s", ctime(&t_0), ctime(&t_1)); return 0; }
Code:Thu Mar 26 04:00:00 2009 Mon Oct 12 20:00:00 2009 Again Thu Mar 26 04:00:00 2009 Mon Oct 12 20:00:00 2009
However, after compiling under MinGW using GCC, the result is:
The last two record equals. Why?Code:Thu Mar 26 04:00:00 2009 Mon Oct 12 20:00:00 2009 Again Thu Mar 26 04:00:00 2009 Thu Mar 26 04:00:00 2009



LinkBack URL
About LinkBacks



