int testi=9; string tests=std::to_string(testi);
如果不能运行,修改 makefile CXX=g++ -std = c++11
char c[1024];
int num=0;
sprintf(c, "%d", num);
//也可以用snprintf
snprintf(c, 1024,"%d", num);
int testi=9; string tests=std::to_string(testi);
如果不能运行,修改 makefile CXX=g++ -std = c++11
char c[1024];
int num=0;
sprintf(c, "%d", num);
//也可以用snprintf
snprintf(c, 1024,"%d", num);
转载于:https://www.cnblogs.com/jiwen/p/4448442.html