打开文件

#include<iostream.h>
#include<fstream.h>
#include<stdlib.h>
void main()
{
	fstream fin,fout;
	char ch;
	fin.open("filedata.txt",ios::in);
	if(!fin)
	{
		cout<<"error,can not open"<<endl;//*********************               c++程序的默认文件打开方式
	}
	fin.close();
}

原文地址:https://www.cnblogs.com/zztong/p/6695319.html