C中的时间(NULL)是什么? [英] What is time(NULL) in C?

查看:54
本文介绍了C中的时间(NULL)是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习了一些基本的 C 函数,并在一些手册中遇到了 time(NULL).

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

这到底是什么意思?

推荐答案

你可以传入一个指向 time_t 对象的指针,time 将用当前时间填充(并且返回值与您指向的值相同).如果你传入 NULL,它只会忽略它,只返回一个新的 time_t 对象,代表当前时间.

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.

这篇关于C中的时间(NULL)是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆