12345678910111213
void act2(){ char string1[100], string2[100]; cout << " Enter word: "; cin.getline(string1, 100); strcpy_s(string2, string1); cout << string2 << endl; cout << strcmp(string1, string2) << endl; if (string1 == string2) cout << string1; }
std::string
using namespace std;
1234567891011121314
void act2() { char string1[100], string2[100]; cout << " Enter word: "; newLine(); cin.getline(string1, 100); strncpy_s(string2, string1, 100); cout << string2 << endl; cout << strcmp(string1, string2) << endl; if (string1 == string2) cout << string1; }