C++ C++字符串复制函数StrCpy算法设计(五)

#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;
}
posted @ 2013-06-25 13:09  Predator  阅读(286)  评论(0编辑  收藏  举报