strcpy函数
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char* mystrcpy(char* a,char* b)
{
if(NULL==a||NULL==b)
{
printf("参数错误\n");
exit(-1);
}
char* p=a;
while(*p++=*b++);
return a;
}
int main()
{
char a[100]="xyzxyz";
char b[200]="123321213";
mystrcpy(a,b);
printf("%s\n",a);
return 0;
}
标签:NULL,return,函数,++,char,strcpy,include
From: https://www.cnblogs.com/yesiming/p/17437349.html