128. Write a program to copy one string to another string using strcpy()?

#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
                char str1[10],str2[10];
                clrscr();
                cout<<"Enter A String : ";
                cin>>str1;
                strcpy(str2,str1);
                cout<<"The Value Inside Str1 = "<<str1<<" And Inside Str2 = "<<str2;
                getch();
}

128.PNG

Advertisements

Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: