C++ sprintf_s 字符串拼接
程序员文章站
2022-05-09 18:24:12
C++ sprintf_s 字符串拼接:定义一个buf 格式如下:
char buf[128] = {0};
例子:
sprintf_s(buf,128,&quo...
C++ sprintf_s 字符串拼接:定义一个buf 格式如下:
char buf[128] = {0};
例子:
sprintf_s(buf,128,"%s%d",appGetGlobal()->getText("id"),appGetGlobal()->getVersion());
m_versionLabel = CCLabelTTF::create(buf,"Arial",20,CCSizeMake(200,25),kCCTextAlignmentLeft,kCCVerticalTextAlignmentCenter);m_versionLabel->setAnchorPoint(ccp(0,0.5));
m_versionLabel->setPosition(ccp(124,38));
this->addChild(m_versionLabel);