bird7727 wrote:The thing is, you CAN press another key other than enter/return! Do you mean so the program executes different actions when you press different keys? Because it was said many times before you don't need to press enter/return.
But, if I compile
- Code: Select all
...
int main() {
cin.get();
return 0;
}
I get a empty console. i can press any key, type in a whole text, and delete it again. nothing happens, the program doesnt care about it. i have to press enter or return if i want to go on.
if i compile system("pause") and, for example press 'a', the program will go on. i cannot type in anything, it doesn't matter which key i press first.
dont get me wrong, we could immediately stop the discussion here, i actually dont care about this little matter, but now that you all say the same i get a bit curious about that thing.
maybe i got something wrong, english is not my "mother tongue" (i think im not the only one though), but you all say
system("pause") and
cin.get() are practically exactly the same, and i dont understand why you say that

edit.. i just want to make clear that i would prefer cin.get() ,too.