编写 strcpy 出错,请帮忙纠错
程序代码:
#include<stdio.h> #include<string.h> int main() { char *q, *p; scanf("%s%s",q,p); printf("%s",strcpy(q,p)); return 0; } char *strcpy(char *strDest,char *strSrc) { char *address=strDest; while(*strSrc!='\0') { *strDest=*strSrc; strDest++; strSrc++; } *strDest='\0'; return address; }