stringstream

#include <iostream>
#include <sstream>
using namespace std;

int main()
{
    stringstream ret;
    ret << "I love you";
    cout << ret.str() << endl;  //把stringstream类型转换为string类型

    return 0;
}

image

posted @ 2022-04-30 19:09  荒年、  阅读(64)  评论(0编辑  收藏  举报