hi
when i want to stop the dos window should i use cin.get() or system("pause")?
in C i used getchar() or system("pause") but what's the best in C++?
thanks in advance
hi
when i want to stop the dos window should i use cin.get() or system("pause")?
in C i used getchar() or system("pause") but what's the best in C++?
thanks in advance
Depends on your definition of "best".
getchar() (in C or C++) or cin.get() (C++ only) are guaranteed to give intended behaviour.
system("pause") is not actually guaranteed to work - in either C or C++.