
----------输入输出IO流
寂寂寂寂寂蝶丶
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
fstream的自实现
fstream的自实现#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> class Stream { public: Stream(char* path = NULL, char* mode = NULL) { //为实现open功能,创建对象时没有初值直...转载 2018-03-03 13:51:05 · 300 阅读 · 0 评论 -
C语言文件操作练习
C语言文件操作练习#include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { FILE* fp = fopen("xx.c", "w+"); if (!fp) cout << "open error" <&am转载 2018-03-03 13:56:04 · 940 阅读 · 0 评论 -
C++标准输入cin
C++标准输入cin#include "stdafx.h" #include <iostream> using namespace std; #include <string> //cin int _tmain(int argc, _TCHAR* argv[]) { int a; double b; string c; //cin >> a >...转载 2018-03-03 14:37:38 · 313 阅读 · 0 评论 -
C++标准输出cout
C++标准输出cout#include "stdafx.h" #include <iostream> using namespace std; #include <iomanip> //流的常用控制符的头文件 //输出 cout //cout cin是对象 int _tmain(int argc, _TCHAR* argv[]) { #if 0 //系统提供的相...转载 2018-03-03 14:38:23 · 417 阅读 · 0 评论 -
IO对象的相关属性与操作
IO对象的相关属性与操作#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //IO 对象不可复制或赋值 //void func(fstream fs) //{ // //} void func(fstream& fs) { } int _tma...转载 2018-03-03 14:40:46 · 358 阅读 · 0 评论 -
文件输入输出ifstream ofstream fstream
ifstream ofstream fstream#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> int _tmain(int argc, _TCHAR* argv[]) { ifstream ifs("aa.c"); //ios::in if (!ifs...原创 2018-03-03 14:42:29 · 323 阅读 · 0 评论 -
C++读写文本文件
C++读写文本文件#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //读写文本文件 int _tmain(int argc, _TCHAR* argv[]) { fstream ifs("src.txt", ios::in); if (!ifs) co...转载 2018-03-03 14:43:27 · 224 阅读 · 0 评论 -
C++读写二进制文件
C++读写二进制文件#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //读写二进制文件 struct Student //里面不能写string { char name[30]; char sex; float math; float chinese...转载 2018-03-03 14:47:17 · 426 阅读 · 0 评论