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);

你可能感兴趣的:(cocos2d-x,移动开发,C++)