如何将int类型的值作为Label显示出来

这个问题貌似很低级,但是我真的不知道:sweat_smile:
就是我有个int类型的值,它随着游戏的进展会不断变化,我想把它作为label显示出来,要怎么弄。
因为Label::createWithTTF()的第一个参数要求类型为(string&),我试过把它强制转换成(std:;string&),但是会报错。
:joy:

看一下cpp-tests工程的label测试例,里面有不断变化的label,新手有想实现的功能的时候,可以先在测试例里找一找

这是 c/c++语言没过关呀。。
你百度一下 int 转 string

sprintf_s格式化输出到字符串。

std::to_string
cocos2d::StringUtils::toString

std::string str1=StringUtils::format("%d",111);然后把str1放入label