请应用指针,主函数初始化2个字符数组,char a[80]=” I am proud of the development of Huaiyin Institute of Technology!”,char b[80]=” I'm a university student!”;用函数调用实现字符串的复制。
#include <stdio.h>
char *strCpy(char *a,char *b)
{
int i=0;
do
{
a[i] = b[i];
}while(b[i++] != 0);
return a;
}
int main()
{
char a[80]="I am proud of the development of Huaiyin Institute of Technology!";
char b[80]="I'm a university student!";
printf("%s",strCpy(a,b));
return 0;
}