发布网友
共1个回答
热心网友
(1)
time_t time ( time_t * timer );The function returns this value, and if the argument is not a null pointer,
the value is also set to the object pointed by timer.
(2)
struct tm * localtime ( const time_t * timer );Uses the time pointed by timer to fill a tm
structure with the values that represent the corresponding local time.
(3)
struct tm {( 4 )
int atoi( const char *str );Convert a string to integer.
你代码中的if语句就是拿当前时间records中第i个时间比较,如果当前时间的小时不大于records[i]的小时,且分钟小于records[i]中的分钟,则返回1(应该是没超出),否则返回0(超出)。
懂了吗,宝贝?
追问其实你的中文回答我还看得懂。我看不懂的是追答struct tm *local; //时间结构体
time_t t;
time_t被定义为位的整形
该函数返回从1970年到执行该函数哪那一刻时间的秒数,将这个秒数赋值给t
//将1970到运行时的秒数转化为年月日时分秒,年从1900年到现在的年数,应该为115,也可以手动转换,不调用这个函数