Thursday 10 September 2015

Copy string

#include < stdio.h >
#include<conio.h>
#include < string.h >
main()
{
  char source[] = "C program";
  char destination[50];
  strcpy(destination, source);
/*strcpy will copy string from source to destination */
  printf("Source string: %s\n", source);
  printf("Destination string: %s\n", destination);
getch();
}

No comments:

Post a Comment