strcpy() library function C Example

How to write a program in C regarding strcpy() library function C Example ?


Solution:
#include<stdio.h>
#include<string.h>
void strcpy(char str2[],char str1[]);
int main(void)
{
    char s1[999999];
    char s2[999999];
    gets(s1);
    gets(s2);
    mystrcpy(s2,s1);
    return 0;
}
void strcpy(char str2[],char str1[])
{
    int i,j=0;
    int x=strlen(str1);
    for(i=x;str2[j]!='\0';i++)
    {
            str1[i]=str2[j];
            j++;
    }
    str2[i]='\0';
    puts(str1);
}


Learn More :