我自己写的strcpy为什么出错?
#include <stdio.h>#include<assert.h>
char *mystrcpy(char *strDest,const char *strSrc)
{
char *address= strDest;
ASSERT ((strDest!=NULL) && (strSrc !=NULL));
while(*strSrc != '\0' )
{
*strDest = *strSrc;
*strSrc++;
*strDest++;
}
*strDest = '\0';
return address ;
}
int main(void)
{
char a[10];
mystrcpy(a,"123");
printf("%s",a);
return 0;
}