iostream fstream istringstream

时间:2019-09-06 20:37:10   收藏:0   阅读:116

1、

(1) 从文件导入数据:ifstream inputstream("D://123.txt");

(2) 获取每行数据:getline( inputstream, text);

(3) 获取每行的第一个数据,和剩余数据 (第一个空格前): inputstream >> word; getline( inputstream, text);

(4) 获取各行的各个数据(空格分隔):istringstream >> word 

2、<< 读取到第一个空格;

3、getline 读取每行;

原文:https://www.cnblogs.com/wllwqdeai/p/11477915.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!