两个头文件都写了呀
#include
#include ,这个作为子函数被调用,会不会是这方面有问题呢
#include
#include
void wenjian(int num) { //数据存储文件
FILE *fp;
if((fp = fopen("shuju.txt","w")) == NULL) {
printf("can not open file shuju.txt!\n");
exit(0);
}
fprintf(fp,"%d",num);
if(fclose(fp)) {
printf("can not close file shuju.txt!\n");
exit(0);
}
}
在VC++ 6.0环境下,无错误编译信息。
我已经写了#include
#include
完整代码的写出来~
追问void wenjian(uint num)//数据存储文件
{
FILE *fp;
if((fp=fopen("shuju.txt","w"))==NULL)
{
printf("can not open file shuju.txt!\n");
exit(0);
}
fprintf(fp,"%d",num);
if(fclose(fp))
{
printf("can not close file shuju.txt!\n");
exit(0);
}
}
#include
#include
typedef unsigned int uint;
void wenjian(uint num)
{
FILE *fp;
if((fp=fopen("shuju.txt","w"))==NULL)
{
printf("can not open file shuju.txt!\n");
exit(0);
}
fprintf(fp,"%d",num);
if(fclose(fp))
{
printf("can not close file shuju.txt!\n");
exit(0);
}
}
int main()
{
return 0;
}
vc6.0编译通过,会不会是什么其它的问题。
我没有写你的这个主函数,我是作为子函数被其他函数调用的
本回答被提问者采纳