C Program to Copy String Without Using strcpy()

To understand this example, you should have the knowledge of the following C programming topics:


As you know, the best way to copy a string is by using the strcpy() function. However, in this example, we will copy a string manually without using the strcpy() function.


Copy String Without Using strcpy()

Output

Enter string s1: Hey fellow programmer.
String s2: Hey fellow programmer.

The above program copies the content of string s1 to string s2 manually.