#include<stdio.h>
int string_copy(char b[],char a[])
{ int i=0;
while(a[i]!='\0')
{ b[i]=a[i];
i++;
}
b[i]='\0';
return b;
}
int main()
{
char s1[50],s2[50];
int l;
printf("enter a string\n");
gets(s1);
string_copy(s2,s1);
printf("The Copied string is: ");
puts(s2);
}
Note: Need to be arranged in compiler after copied
OutPut:
enter a string
Hello World
The Copied string is: Hello World