fstream.h中已经包含iostream.h了,为什么...
#include <fstream>
using namespace std;
int main()
{
int a[10];
ofstream outfile;
outfile.open("student.txt",ios::app);
if(!outfile)
{
cerr<<"open error!"<<endl;
exit(1);
}
cout<<"enter 10 integer numbers:"<<endl;
for(int i=0;i<10;i++)
{
cin>>a[i];
outfile<<a[i]<<" ";
}
outfile.close();
return 0;
}fstream.h中已经包含iostream.h了,为什么还提示错误:
'cerr' : undeclared identifier
'cout' : undeclared identifier
...
加上#include <iostream>就对了。
...全文
相关推荐
iostream与iostream.h的区别详细解析
以下是对C++中iostream与iostream.h的区别进行了详细的分析介绍,需要的朋友可以过来参考下
编程头文件:fstream.h
如果你的fstream.h文件缺失,或者出了问题,可以直接下载这个文件,编程常用
vc++iostream.h&fstream;.h.rar
VC2003之后这两个头文件没有了,但是目前通过vc编译的帧需要这两个头文件,本人用作以太网帧的传输,供大家参考
c++ iostream 教程 PPT
C++ solution is a set of classes defined in the iostream and fstream header files.
FILE文件操作基本技巧pdf
iostream.h包含ios, iostream, istream,ostream以及endl等操纵符 fstream.h:包含fstream,ifstream, ofstream, fstreambase等类定义以及iostream中的所有内容 strstrea.h:包含strstream,istrstream,ostrstream, strstreambase等类定义以及iostream.h中的所有内容 iomanip.h:包含setw等大多数操纵符的定义以及iostream.h中的所有内容


