C++文件读写示例fstream
2015-05-19 20:35
330 查看
#include<iostream> #include<fstream> #include<string> using namespace std; void main() { char ch; fstream openfile("a.txt",ios::out); openfile<<"aaaaaaaaaaaddddddddddddffffffffffffffffffffsssssuuuuuuuuuus";//写入 openfile.close(); openfile.open("a.txt",ios::in); while(!openfile.eof()) { openfile.get(ch);//读出 cout<<ch; } cout<<endl; openfile.close(); }
相关文章推荐
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- 用C++中STL提供的fstream和stream_iterator读写二进制文件。
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- 使用C++文件流库fstream,读写操作十六进制文本文件
- C++文件读写详解(ofstream,ifstream,fstream)
- C/C++文件读写操作——FILE*、fstream、windowsAPI
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- c++文件读写 fstream
- C++文件读写详解(ofstream,ifstream,fstream)
- [C/C++] C语言文件读写示例程序 xcb
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)
- C++文件读写详解(ofstream,ifstream,fstream)(转载)
- C++文件读写详解(ofstream,ifstream,fstream)