Hello, I'd just got my first post in this forum. And this place seems like has a lot of resources. I just have this problem of mine with my project that I'm supposed to pass by this tuesday and I've been trying to fix this for already a week and have already tried a lot of things.
The code is here:
I'm having a problem about storing the time information to a variable.My project is about payroll and I have a time-in and time-out of workers there. However, whenever I print their time-ins and time-outs in the display of workers, the time on time-in and time-out are always the same even though I got them from different time. I hope you will answer my question. Thanks!Code:#include<stdio.h> #include<stdlib.h> #include<time.h> main() { time_t start_time,end_time; char* start,*end; printf("Press enter to get the date today\n"); system("PAUSE"); start_time = time(NULL); start = ctime(&start_time); printf("%s\n",start); printf("Enter again to get the latest date\n"); system("PAUSE"); end_time = time(end_time); end = ctime(&end_time); printf("%s\n",end); printf("And the time a while ago is %s\n",start); system("PAUSE"); }![]()



1Likes
LinkBack URL
About LinkBacks
. I just have this problem of mine with my project that I'm supposed to pass by this tuesday and I've been trying to fix this for already a week and have already tried a lot of things. 



