在C++標準庫裏面,使用stringstream 可以用於各種數據類型之間的轉換
例如string 轉 int
std::string strId = "1";
int id = 0;
std::stringstream ss;
ss << strId.c_str();
ss >> id;
在C++標準庫裏面,使用stringstream 可以用於各種數據類型之間的轉換
例如string 轉 int
std::string strId = "1";
int id = 0;
std::stringstream ss;
ss << strId.c_str();
ss >> id;