Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Did C have any Year 2000 problems?
Did C have any Year 2000 problems?
✍: Guest
No, although poorly-written C programs might have.
The tm_year field of struct tm holds the value of the year minus 1900; this field therefore contains the value 100 for the year 2000. Code that uses tm_year correctly (by adding or subtracting 1900 when converting to or from human-readable 4-digit year representations) has no problems at the turn of the millennium. Any code that used tm_year incorrectly, however, such as by using it directly as a human-readable 2-digit year, or setting it from a 4-digit year with code like
tm.tm_year = yyyy % 100; /* WRONG */
or printing it as an allegedly human-readable 4-digit year with code like
printf("19%d", tm.tm_year); /* WRONG */
would have had grave y2k problems indeed.
(The y2k problem is now mostly old history; all we have left to do is fix all the 32-bit time_t problems by 2038...)
2015-08-03, 1214👍, 0💬
Popular Posts:
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...
What is the value of this expression? +1-2*3/4 -0.5
What is the concept of XPOINTER? XPOINTER is used to locate data within XML document. XPOINTER can p...
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?...
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...