C++字符串赋值strcpy函数的使用
char *pStr = new char[20]; char *pSource = "ganquanfu"; strcpy(pStr,pSource); cout << pStr <<endl;
/*string name = "ganquanfu";
const char *names = name.c_str()
;
cout<<names<<endl;
*/
char *pStr = new char[20]; char *pSource = "ganquanfu"; strcpy(pStr,pSource); cout << pStr <<endl;
/*string name = "ganquanfu";
const char *names = name.c_str()
;
cout<<names<<endl;
*/