||
如下面这段代码,故意将time_t结构体所依赖的头文件time.h注释掉, 编译看看提示什么错误。
/*timenow.c*/
#include <stdio.h>
//include <time.h>
int mian(void)
{
time_t now;
now= time(NULL);
printf(“The time now is %s”,ctime(&now));
return 0;
}
编译以上代码,gcc显示time_t未定义,这是因为time_t包含在time.h中,而time.h又被注释掉了。
Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )
GMT+8, 2024-11-24 10:34 , Processed in 0.029168 second(s), 18 queries , Gzip On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.