/* Program 11-13

   Program to copy one string to another using pointers */

void copy_string (char *from, char *to)
 {
  for ( ; *from != '\0'; ++from, ++to )
   *to = *from;

  *to = '\0';
 }

main ()
{
 static char string1[] = "This is a string to be copied.";
 static char string2[50];

 copy_string (string1, string2);
 printf ("%s\n", string2);

 copy_string ("So is this.", string2);
 printf ("%s\n", string2);
}


/* Program Output

This is a string to be copied.
So is this.

*/

