Why is Visual Studio doing this!?
Go to solution
Solved by trag1c,
Move the cin.get() function call to the line before the end of your main and it will halt closing the program so that you can view your input.
1 minute ago, Enderman said:you need to have
using namespace std;at the top of your code
and
system("pause");where you want it to stop
He has using using namespace std; at the top of of his file just below the includes. Anything to do with system() should be avoided as it introduces many vulnerabilities to the application and system.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now