Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将更多来自不同来源的字符串添加在一起,但我似乎没有工作...... 我的代码
int num = 0; string s = std::to_string(num); this->richTextBox1->Text = "Copying files... (" + s + "%)"; //this doesn't work
PS:如何添加代码 -num = num + 1
num = num + 1
它不起作用是因为该Text属性不是std::string.
Text
std::string
您可以使用以下方法将结果转换std::string为:const char*c_str()
const char*
c_str()
this->richTextBox1->Text = ("Copying files... (" + s + "%)").c_str();