c++ 如何将int 转换为string
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);