----------输入输出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 · 250 阅读 · 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 · 876 阅读 · 0 评论 -
C++标准输入cin
C++标准输入cin#include "stdafx.h"#include <iostream>using namespace std;#include <string>//cinint _tmain(int argc, _TCHAR* argv[]){ int a; double b; string c; //cin >> a >...转载 2018-03-03 14:37:38 · 253 阅读 · 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 · 348 阅读 · 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 · 304 阅读 · 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 · 270 阅读 · 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 · 187 阅读 · 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 · 366 阅读 · 0 评论