C++中,open 的用法?

来源:百度知道 编辑:UC知道 时间:2024/07/02 04:18:19
open 的用法,最好能写出例子!

ifstream in
in.open("D:\\hehe.txt",ios::in||ios::out)
if(!in)
{
cout<<"文件打开错误!"<<endl;
system("pause");
exit(0);
}
while(!in.eof())
{
in.read((char *)(&tele[iNum]),sizeof(tele[iNum]));
iNum++;
}
in.close();