您的位置:首页 > 编程语言 > C语言/C++

c++字符窜切割

2015-10-21 10:04 309 查看
#include <iostream>

#include<sstream>

//using namespace std;

int main()

{

    string s="string|char|int|boolean|long|what|lije";

    stringstream ak(s);

    string sub;

    while(getline(ak,sub,'|')){

        cout<<sub<<endl;

    }

    s.append("e");

    cout << s<< endl;

    return 0;
}

//getline(stringstream,string,char)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: