At the end of my code, I often put this to keep the program from closing:
while (1);
I use Microsoft VS and I prefer to close the program by clicking the red x in the corner rather than pressing enter (I associate enter with entering a value, rather than closing a program).
Are there any disadvantages or advantages to this over cin.get and cin.ignore?