Pls can someone help me with guideline on how to write a program to calculate date arithmetic (e.g. no. of days b/w Jan 6, 1990 and August 3, 1992. Am just a beginner.
Seconds gives a reference to number of seconds since Jan 1st, 1970, when used like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
/* time example */
#include <stdio.h>
#include <time.h>
int main ()
{
time_t seconds;
seconds = time (NULL);
printf ("%ld hours since January 1, 1970", seconds/3600);
return 0;
}
The ctime library is where you want to start looking. I don't want to give you the exact answer, but here is a link to more info on the <ctime> library.