黑暗之魂1洋葱骑士死了:c小问题 求救

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 01:37:18
//等待一个时间间隔的子程序,输入参数是整数毫秒,1000毫秒是1秒.
//Timer是定时器,SetTimer是设置定时器.
#include <stdio.h>
#include <time.h> //头文件
void wait( long m_seconds )
{ clock_t endwait;
endwait=clock()+m_seconds; // * CLK_TCK
while (clock()<endwait)
{ FILE *fp;
fopen(fp,"e://a/showtime.txt","w");
fprintf(fp,"%ld",clock());
fclose(fp);
}
}
main()
{ long t;
printf("Input the time you want: t\n");
scanf("%ld",&t);
wait(t);
printf("Over\n");
}
在调试过程中出现内存不能读取,请各位大侠帮帮忙啊.

fopen(fp,"e://a/showtime.txt","w");
文件不存在或打开错误