http://www.cnblogs.com/leehongee/p/3642308.html
//int 转 CCstringint num=5; CCString* ns=CCString::createWithFormat("%d",num); //CCstring 转 intint px = ns->intValue();//将CCString 转换为int的方法,转成float类型有 floatValue()//====================================== //CCString 转 charconst char *string= ns->getCString(); //char 转 CCStringCString.Format(”%s”,char *)//char 转cstring CCString* ns=CCString::createWithFormat("%s",char *);//====================================== //string 转 charconst char *string=std::string("STRING").c_str();char 转 stringstring s(char *);//====================================== //string 转 intstd::string s("1234");int n = std::atoi(s.c_str());//函数原型int atoi(const char *); //int 转 stringint a=3;CCString* ns=CCString::createWithFormat("%d",a);string s=ns->m_sString;//======================================//string 转 CCStringstd::string str = "123";CCString* ns=CCString::createWithFormat("%s",str.c_str());CCString 转 stringstd::string s= ns->m_sString;//ns是一个CCString*类型//======================================//char 转 int char *buf = "1122"; int n = std::atoi(buf);//int 转 charint a=3;CCString* ns=CCString::createWithFormat("%d",a);const char* s=ns->getCString();