#include< iostream> #include <boost/algorithm/string.hpp> using namespace boost; using namespace std; void StrCpy(char szDestination[],char szSource[]) { int i=0; while (szSource[i]!='\0'){ szDestination[i]=szSource[i]; i++; } szDestination[i]='\0'; } int main(){ char szDes[10]; char szSource[20] = "C++程序设计"; //strcpy(szDes,szSource); StrCpy(szDes, szSource); cout << szDes << endl; /*string szDes; string strSource= "ganquanfu"; szDes = trim_left_copy(strSource); cout << szDes <<endl;*/ int wait; cin >> wait ; return 0; }
转载于:https://www.cnblogs.com/ganquanfu2008/p/3154484.html