What is time(NULL) in C?

后端 未结 8 1104
别跟我提以往
别跟我提以往 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条回答
  •  孤街浪徒
    2020-12-07 19:36

    The call to time(NULL) returns the current calendar time (seconds since Jan 1, 1970). See this reference for details. Ordinarily, if you pass in a pointer to a time_t variable, that pointer variable will point to the current time.

提交回复
热议问题