字符串str 与 char数组的赋值
//可行1
char str[256] = "I am a boy";
string stemp ;
stemp = str; //直接指针赋值。
CCLog("stemp = %s", stemp.c_str());
//可行2
char* str = "I am a boy";
string stemp ;
stemp = str;
CCLog("stemp = %s", stemp.c_str());
//可行3
char str[256]={};
string stemp = "I am a boy.";
memcpy(str, stemp.c_str(), sizeof(stemp));
CCLog("stemp = %s", str);
//可行4
char str[256]={};
string stemp = "I am a boy.";
char *temp = &stemp[0];
CCLog("stemp = %s", temp);