您的位置: 首页 > IT文章 > 打开文件 打开文件 分类: IT文章 • 2022-04-06 22:00:50 #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(); }