#include<iostream>
#include<assert.h>
using namespace std;
char *strcpy(char *strDest,const char *str)
{
assert((strDest!= NULL) && (str !=NULL));
char *address = strDest;
while((*strDest++ = *str++ ) !='\0');
return address;
}
void main()
{
char *strSrc = "i am happy!";
char strDest[100];
char *address = strcpy(strDest, strSrc);
while(*address != '\0')
cout<<*address++;
}
字符串的复制
最新推荐文章于 2023-09-16 10:50:51 发布