C++中对文件的操作

在C++中对文件的操作使用以下类:

写文件:

ofstream::ofstream;


ofstream ofs("5.txt");
ofs.write("http://agilor.iscas.ac.cn",strlen("http://agilor.iscas.ac.cn"));
ofs.close();

读文件:

ifstram::ifstream;

ifstream ifs("5.txt");
char ch[100];
memset(ch,0,100);
ifs.read(ch,100);
ifs.close();
MessageBox(ch);




猜你喜欢

转载自blog.csdn.net/dyz_123456/article/details/71122860
今日推荐