一种是使用stringstream类
stringstream ss;
ss<<"D:\\OPEN_CV\\deep_opencv\\code-master\\Chapter5_NumberPlateRecognition\\test\\"<<i<<".jpg";
string filename = ss.str();
至于stringstream 类我还不太掌握 先这么用着
一种是使用string 类
string filename;
filename= "D:\\OPEN_CV\\deep_opencv\\code-master\\Chapter5_NumberPlateRecognition\\test\\";
filename +=itos(i);
filename += ".jpg”
其中 itos 函数要自己定义
string itos(int i)
{
stringstream s;
s<<i;
return s.str();
}
他的内部还是调用了stringstream类