已经有#include<stdlib.h>这个头文件,为啥会'exit' : undeclared identifier
代码如下:
程序代码:#include <stdio.h>
#include<stdlib.h>
#include <time.h>
int main(void)
{
FILE *p;
char *a;
if((p=fopen("d:\\时间测试.txt","w"))==NULL)/* 以写方式打开文本文件 */
{
printf(" file can not open:\n");
exit(0);
}
time_t now;
now = time(NULL);//获取系统的时间
a=ctime(&now);//把日期和时间转换为字符串
fprintf(p,"%s\n",a);
fclose(p);
return 0;
}








