我的烦恼---来自studio2005的烦恼

来源:互联网 发布:淘宝网平跟舞蹈鞋 编辑:程序博客网 时间:2024/04/28 00:48
#include"iostream"
#include"stdio.h"
#include"fstream"
using namespace std;
void main()
{
 ofstream file1;
 file1.open("A://write1.dat");
 if(!file1)
 {
  cerr<<endl<<"A://write1.dat not open"<<endl;
  exit(-1);
 }
 for(int k=0;k<=100;k++)
  file1<<k<<'/t'<<endl;
 file.close();
}
------ 已启动生成: 项目: 314, 配置: Debug Win32 ------
正在编译...
11.cpp
./11.cpp(16) : error C2065: “file”: 未声明的标识符
./11.cpp(16) : error C2228: “.close”的左边必须有类/结构/联合
        类型是“'unknown-type'”
生成日志保存在“file://d:/Projects/313/Debug/BuildLog.htm”
314 - 2 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ========== 
原创粉丝点击