Strcpy in c

strcpy() function copies one string to other. Here the main point is the destination string size should be greater than size of the source string. If there are any characters in destination string those will be deleted and source string characters will be replaced.



here 2nd string is copied into while using printf function we should choose first string for the output.


int main()
char s1[30]="codeskulls";
char s2[30]="website";
printf("Before coping :");
printf("\n str1 : %s \n str2: %s \n\n",s1,s2);
printf( "\nafter coping) = %s",s1);