I ran it in the debugger. All the code executed. cin.get() isn't doing what you think it is. Try getch if you want to stop the execution and wait for input.