c++记录
来源:互联网 发布:android答题系统源码 编辑:程序博客网 时间:2024/06/14 21:23
- 使用istringstream区分待空格的字符串
使用istringstream区分待空格的字符串
#include <sstream> #include <string> #include <vector> #include <iostream> vector<string> xlist; string text = "abc def g h"; // 创建istringstream对象ss,把text传给ss istringstream ss(text); string word; while (ss >> word) { xlist.push_back(word); } // 循环输出xlist for (vector<int>::size_type ix = 0; ix != xlist.size(); ++ix) { cout << xlist[ix] << endl; }
- istringstream类用于执行C++风格的串流的输入操作。
- ostringstream类用于执行C风格的串流的输出操作。
- strstream类同时可以支持C风格的串流的输入输出操作。
阅读全文
0 0
- C记录
- C记录
- C++/C博客记录
- C/C++bug记录
- C 学习记录 出错记录
- C指针学习记录
- Objective-C问题记录
- C语言学习记录
- Objective-C 学习记录
- C语言记录
- objective-c 错误记录
- c 学习记录 一
- C语言活动记录
- C代码记录一
- objective c 语法记录
- c 指针学习记录
- C, C++零碎记录
- C 语言 记录
- linux网络驱动分析
- 【Person Re-ID】SVDNet for Pedestrian Retrieval
- 学徒浅析Android开发——SO文件的混淆
- 基于IC设计的实用ISP介绍
- 【Deep Learning】win10下配置tensorflow1.4(gpu版本)
- c++记录
- 1023. 组个最小数 (20)
- mysql分库分表
- 《第一本Docker书》读书总结(一)第4章
- WIFI开发版实验,ssh网络服务开发板访问虚拟机ubuntu文件中,ssh连接ubuntu时ssh: Exited: Error connecting: Connection refused
- python 安装urllib
- Linux下tp5找不到模板文件解决方法
- LVS+KEEPALIVED高可用群集实验分步配置简要
- java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must b