std::cout << std::endl << "Press Enter to exit.";
std::cin.get();
To prevent your program from closing (which is perfectly normal, by the way), you can for example wait for keyboard input. Look at the C/C++ new project template to learn how that is done (or look at a "learning C" tutorial.
Add this before return 0;Code: cppstd::cout << std::endl << "Press Enter to exit.";
std::cin.get();