Alex Rivera | Logout

What is time(NULL) in C?

Asked 2011-09-26T02:58:16.253
78

I learning about some basic C functions and have encountered time(NULL) in some manuals.

What exactly does this mean?

Edit
Report

1 Answer

3

The time function returns the current time (as a time_t value) in seconds since some point (on Unix systems, since midnight UTC January 1, 1970), and it takes one argument, a time_t pointer in which the time is stored. Passing NULL as the argument causes time to return the time as a normal return value but not store it anywhere else.

answered 2011-09-26T03:02:22.277

Your Answer