ASWIN
asked on
to find the previous date
A program in C to accept a date and to print its previous date and its next date
again homework!
How do you guys guess that it is homework problem? ASWIN has no profile.
Sometimes problems are simple like elemetary homework problems but not always.
Sometimes problems are simple like elemetary homework problems but not always.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forget the previous answer, here is more
use the tm_yday item in the tm struct to set the day. Use the localtime and strftime functions, and the struct tm.
time_t now:
struct tm *tmnow;
struct tm tmtomorrow:
char szTomorrow[128]:
now = time(NULL);
tzset();
tmnow = localtime();
memset(&tmtomorrow,0,sizeo f(struct tm));
tmtomorrow.tm_yday = tmnow->tm_yday + 1;
strftime(szTomorrow,128,"% x",&tmtomo rrow);
use the tm_yday item in the tm struct to set the day. Use the localtime and strftime functions, and the struct tm.
time_t now:
struct tm *tmnow;
struct tm tmtomorrow:
char szTomorrow[128]:
now = time(NULL);
tzset();
tmnow = localtime();
memset(&tmtomorrow,0,sizeo
tmtomorrow.tm_yday = tmnow->tm_yday + 1;
strftime(szTomorrow,128,"%