The pause command is an internal cmd.exe command and can't be overridden, as is erroneously claimed in at least one other answer. And for use in automation of some task that pause is very much undesired! For interactive execution you have to press a key at the end to no purpose whatsoever. When you run the program from the command line. And of course no problem at all when you run it from the command line. To keep the program's console window open at the end when you run it from Visual Studio, use Ctrl+ F5 to run it without debugging, or else place a breakpoint at the last right brace } of main. Using system('pause') is Ungood Practice™ because