This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Tuesday 6 August 2013

Program to copy the contents of one string to another string using strcpy() function

#include<stdio.h>
void main()
{
char original[50], duplicate[50];
clrscr();
printf("Enter the text: ");
scanf("%s", original);
strcpy(duplicate, original);
printf("\nOrignal string: %s", original);
printf("\nDuplicate string: %s", duplicate);
getch();
}


1 comment: