Copying String
Learn how to copy the source string into the target string.
We'll cover the following...
We'll cover the following...
The strcpy() function
strcpy( ) copies the source string, str1, into the target string, str2. The basic syntax of the strcpy() function is given below:
char* strcpy(const char *str2, const char *str1);
strcpy( ) takes two strings in its input and, then, copies one string into the other, character by character. The order of passing base addresses to strcpy( ) must always be the target, followed by the source. Here, *str2 points to the target string, and *str1 points to the source string.
See the code given below!
The xstrcpy() function
Instead of ...