Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Writing own version of the " strcpy( ) " library function which is named mystrcpy( ) */
- #include<stdio.h>
- #include<string.h>
- void mystrcpy(char str2[],char str1[]);
- int main(void)
- {
- char s1[999999];
- char s2[999999];
- gets(s1);
- gets(s2);
- mystrcpy(s2,s1);
- return 0;
- }
- void mystrcpy(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);
- }
Add Comment
Please, Sign In to add comment