Back To C++ String Manipulation Functions
//program to demonstrate strcpy function in string.h to copy one string to another #include
#include
#include
void main() { char name1[20],name2[20]; clrscr(); cout<<"enter name 1"; cin>>name1; cout<<"\ncopying name1 to name2\n"; strcpy(name2,name1); cout<<"\nstring copied\n"; cout<<"name2 is "<