从 stringstream 中获取拼接后的 string

需求 如何从 stringstream 中获取多次拼接后的 string, 直接使用 >> 效果并不好. 解决 使用 stringstream 的 str() 这个类函数。 stringstream ss; string s = ""; ss << "123"; ss << "456"; s = ss.str(); 参考 c++ stringstream(老好用了)

2023-04-06 · 1 min · 32 words · RamLife