C++ having cin read a return character
I was wondering how to use cin so that if the user does not enter in any value and just pushes ENTER that cin will recognize this as valid input. Martin Cote You will probably want to try std::getline : #include <iostream> #include <string> std::string line; std::getline( std::cin, line ); if( line.empty() ) ... I find that for user input std::getline works very well. You can use it to read a line and just discard what it reads. The problem with doing things like this, // Read a number: std::cout << "Enter a number:"; std::cin >> my_double; std::count << "Hit enter to continue:"; std::cin >>