菜鸟求助 bcb time函数

catface0511 2003-08-04 10:32:21
time_t t1,t2,t3,t4;
t2=time(&t1);
lbl1->Caption=ctime(&t1);
lbl2->Caption=ctime(&t2);
t3=time(NULL);
lbl3->Caption=ctime(&t3);
time(&t4);
lbl4->Caption=ctime(&t4);
为什么 T1 和T2经过那样的等式 就都可以显示当前时间了?
为什么 T3是 函数参数为NULL的返回值也可以显示当前时间?
麻烦哪位指教下
...全文
122 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingfish 2003-08-04
  • 打赏
  • 举报
回复
time_t time(time_t *timer);
return The number of seconds since January 1, 1970

如果参数不是NULL, 有返回值,同时会写入timer
如果是NULL, 只有返回值

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧