C++ sprintf_s 字符串拼接

来源:互联网 发布:焊接机器人模拟软件 编辑:程序博客网 时间:2024/06/14 20:46

定义一个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);
0 0
原创粉丝点击