I am attempting to write a program that take the system clock and store the individual components of the time (hour, minutes, seconds, etc.) in separate variables or an array. Does anyone know how to do this? I am newbie, so bear with me. Thanks.
I am attempting to write a program that take the system clock and store the individual components of the time (hour, minutes, seconds, etc.) in separate variables or an array. Does anyone know how to do this? I am newbie, so bear with me. Thanks.
I think you need the localtime function. See localtime(3) - Linux man page .
To get the time_t parameter to pass into localtime, use time_t myTime = time(NULL);
Available on linux or Windows.
Thanks a bunch. I'm new to C programming.