您的位置:首页 > 编程语言 > C语言/C++

C++ sprintf_s 字符串拼接

2017-02-07 10:18 337 查看
定义一个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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: