C语言 文件怎么引用

作者在 2015-05-13 14:05:38 发布以下内容

 save_message( )
 { FILE *fp;
    int i;
 if((fp=fopen("dom.txt","wt"))==NULL)
 {
   printf("读文件错误!\n");
   return 0;
  }
  for(i=0;i<sum;i++)
  if(fwrite(&s[i],sizeof(struct dom),1,fp)!=1)
  printf("写文件错误!\n");
  fclose(fp);
 }
提示错误:

[Error] E:\My C-F\Projects\宿舍管理系统.cpp:27: error: ISO C++ forbids declaration of `save_message' with no type

默认分类 | 阅读 1169 次
文章评论,共0条
游客请输入验证码
文章分类
文章归档
最新评论