自定义 strcpy函数

//自定义strcpy函数
# include<stdio.h>
char c[50]={0};
char b[50]={0};
void strcpy1(char *a,char *b);
int main()
{
    gets(c);
    gets(b);
    strcpy1(c,b);
    puts(c);
    return 0;
}

void strcpy1(char *a,char *b)
{
    int i=0;
    while(1)
    {
        a[i]=b[i];
        if(b[i]==0)break;
        i++;
    }
}

运行结果:

原文地址:https://www.cnblogs.com/bboykaku/p/12431740.html