In this section, you will learn how to copy the string in C. You can see in the given example, two string variables st1 and st2 are created. A string is passed to the st1. Then we have used the library function strcpy() provided by the header file <string.h> that will copy the specified string from st1 to st2.
Here is the code:
Output will be displayed as:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial