include iostream using namespace std int main char string1 100 string2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;
int main() {
char string1[100], string2[100];
cout << "Enter string:" << endl;
cin.getline(string1, sizeof(string1));
memcpy(string2, string1, sizeof(string1));
cout << "Copied string:" << endl << string2;
return 0;
}