I'm trying to figure out how to create a time system for a video game, but the ctime reference is garbage for somebody who has never toutched that library before. can somebody point me in the right direction.
i just need the time system to do two things: (1) present the hour:minute and the month, day, year to the player. (2) present the player with how many hours since he started a new game.
i dont want links for this site, i find them useless because this is a library i have never used. i need to have the library explained a little better.
the only thing i understand is the time data structure
Moschops thank you this is helping me. So rawtime is a variable of data type time_t? and what does the time() function do? timeinfo is a reference to the data structure tm which then equals the function localtime?
me555 i would appreciate it if you only posted useful information.
time - get time in seconds time_t time(time_t *t);
time() returns the time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
If t is non-NULL, the return value is also stored in the memory pointed to by t.