C++中string和int之间的转换 Posted on 2019-02-08 Edited on 2021-01-31 In C++ Views: 下述转换属于字符串流,需要附带头文件 1#include<<sstream> int 转string12345int number=100;string str;stringstream buffer;buffer<<number;buffer>>str;</span> string转int12345int number;string str="666";stringstream buffer;buffer<<str;buffer>>number;</span>