利用标准库的to_string函数
测试程序:
void test()
{
vector<string> joints;
for (int i = 1; i < 6; i++)
{
string str = "joint";
str += std::to_string(i);
joints.push_back(str);
}
for (vector<string>::iterator it = joints.begin(); it != joints.end(); it++)
{
cout << *it << endl;
}
}