清空stringstream缓存

std::stringstream ss;
ss << "123";

ss.clear();//这仅仅是重置流的标志

ss.str("");//这样是清空缓存流的内容

你可能感兴趣的:(C++,基础)