I learning about some basic C functions and have encountered time(NULL)
in some manuals.
What exactly does this mean?
You can pass in a pointer to a time_t
object that time will fill up with the current time (and the return value is the same one that you pointed to). If you pass in NULL
, it just ignores it and merely returns a new time_t
object that represents the current time.
Nb:time(&timer);
is equivalent to timer = time(NULL);