What is time(NULL) in C?

后端 未结 8 1084
别跟我提以往
别跟我提以往 2020-12-07 19:12

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

What exactly does this mean?

8条回答
  •  Happy的楠姐
    2020-12-07 19:43

    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.

提交回复
热议问题