首页 > 编程 > C++ > 正文

C++ sprintf_s 字符串拼接

2019-11-09 18:15:24
字体:
来源:转载
供稿:网友

定义一个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);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选