// Marilyn.cpp (c) Kari Laitinen // http://www.naturalprogramming.com/ // 1997-??-?? File created. // 2013-11-06 Last modification. // It seems that also the string funcion strcmp() is included // with the following #include command. #include using namespace std ; int main() { char name_to_be_known[] = "Marilyn Monroe" ; char name_from_keyboard[ 40 ] ; cout << "\n Who played a main role in movies:" << "\n\n \"How To Marry a Millionaire\" (1953)" << "\n \"The Seven Year Itch\" (1955)" << "\n \"The Misfits\" (1961) \n\n ? " ; cin.getline( name_from_keyboard, sizeof( name_from_keyboard ) ) ; if ( strcmp( name_from_keyboard, name_to_be_known ) == 0 ) { cout << "\n Yes, that is correct.\n" ; } else { cout << "\n No, it\'s Marilyn Monroe.\n" ; } }