c++读写txt文档
来源:互联网 发布:win10共享设置软件 编辑:程序博客网 时间:2024/06/05 00:35
#include <iostream>#include <fstream>#include <string>#include <cassert>using namespace std;int main(){int i=666;ofstream out("a.txt");if(out.is_open()){out<<"gaoxudong"<<endl;out<<"lihail"<<endl;out<<i<<endl;////结果: 在a.txt中写入: //gaoxudong//lihail//666}out.close();char buffer[256]; ifstream in("a.txt"); if (! in.is_open()) {cout << "Error opening file";return -1; } while (!in.eof() ) //如果读文件到达文件末尾,返回true。 { in.getline (buffer,100); cout << buffer << endl; } in.close(); return 0;}
阅读全文
0 0
- 读写txt文档
- txt文档读写注意事项
- C# 读写txt文档
- c++读写txt文档
- 【C#】txt的读写
- 【c#】读写txt文件
- c#读写txt文档代码
- java读写Txt文档(转)
- Java读写txt文档内容
- C读取txt文档
- C#TXT文本的读写
- C语言读写txt文件
- C语言读写txt文件
- c读写txt文件示例
- 关于android txt文档读写路径问题
- C#richTextBox1保存txt文档
- C-语言TXT文件的读写
- MFC读写固定格式的txt文档+生成目录等
- 使用Unity实现动态2D水效果
- MySQL表复制数据复制解析
- 405错误(An unhandled exception occurred while processing the request)
- Internet和Intranet有什么区别?
- JavaScript总结记录3(学习JavaScript高级程序设计第三版)
- c++读写txt文档
- linux下vim编辑器操作技巧以及配置
- 使用Spring Boot日志框架在已有的微服务代码中添加日志功能
- nodejs类从module里面导出的多种方法
- Java虚拟机中对象的内存布局及访问定位
- Eclipse中Maven的配置
- “领域驱动开发”实例之旅
- 调试接口
- 关于unity自带的雾