经常需要循环读入多组序号的图像,需要将int转换为string,简单的函数代码如下:
#include <sstream>#include <string> string IntToString(int num) { stringstream ss; string s; ss << num; ss >> s; return s; }
时间: 2024-10-29 11:11:38
经常需要循环读入多组序号的图像,需要将int转换为string,简单的函数代码如下:
#include <sstream>#include <string> string IntToString(int num) { stringstream ss; string s; ss << num; ss >> s; return s; }