Copy one String into another String
This operation is used to copy all the characters of one string into another string.
In order to copy , we have to start from the first character of the given string which is at index 0 in the array and copy that character into another string. After copying first character we have to moves on to the second character and this process is repeated until NULL character is encountered in the given string.
Algorithm to Copy one String into another String
|Step 1:||Length = 0|
|Step 2:||Repeat up to step 4 while S1 [Length] ≠ NULL|
|Step 3:|| S2 [Length] = S1 [Length]
Length = Length + 1
|Step 4:||S2[Length]= NULL|
Program to Copy one String into another String
void scopy(char *s1,char *s2);
puts("Copied String is:");
void scopy(char *s1,char *s2)