char pointscloud[128];
sprintf(pointscloud, "/model%d/action%d/%04dpointscloud.txt", model, action, fileIndex);

使用c++的stringstream 。

添加头文件

#include <iostream>
#include <iomanip>

stringstream ss;
ss << "/body3DCoordinates" << i << "_" << setw(4) << setfill('0') << j << ".txt";
cout << ss.str() << endl;

https://zhidao.baidu.com/question/284142736.html

http://bbs.csdn.net/topics/10129157