C++ 如何在c++;?
我做了各种实现,但它们需要很长时间 谁能给我们最好的实施方案? 例如,在字符串末尾添加一个十位数字 我在互联网上没有找到一个好答案C++ 如何在c++;?,c++,string,C++,String,我做了各种实现,但它们需要很长时间 谁能给我们最好的实施方案? 例如,在字符串末尾添加一个十位数字 我在互联网上没有找到一个好答案\include #include <iostream> std::string a="string"; long n=1703705707; a.append(std::to_string(n)); //becomes "string1703705707" std::string a=“string”; 长n=1
\include
#include <iostream>
std::string a="string";
long n=1703705707;
a.append(std::to_string(n)); //becomes "string1703705707"
std::string a=“string”;
长n=1703705707;
a、 追加(std::to_string(n))//变为“string1703705707”
是的,我使用它,但我的编译器说(to_字符串)在此范围内不可递减!还有别的办法吗?你能发布相关代码吗?你是想在全局范围内做这件事吗?我是说在功能之外?试着在main()或其他什么地方这样做。我的代码太长了,大约130行!