首页 > 编程语言 > 详细

C++Primer第五版 第八章 IO库

时间:2020-06-11 15:57:37      阅读:55      评论:0      收藏:0      [点我收藏+]

知识点1:IO类分别定义在三个独立的头文件中

定义了用于读写流的基本类型

定义了读写命名文件的类型

定义了读写内存string对象的类型

8.1

istream &iofunc(istream &is) {
	string s;
	while (is >> s) {
		cout << s << endl;
	}
	is.clear();
	return is;
}`

8.2

include

include

using namespace std;

istream &iofunc(istream &is) {
string s;
while (is >> s) {
cout << s << endl;
}
is.clear();
return is;
}

int main() {
iofunc(cin);
return 0;
}`

C++Primer第五版 第八章 IO库

原文:https://www.cnblogs.com/wsl540/p/13093470.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!