[Help]Keeping program open
Hello, I'm fairly new to C++, and I am currently doing as one of the posts I found said to do. I got some books on c++ programming and am currently stuck having a problem keeping a program open after I have compiled and ran it. I am using Bloodshed DevC++ if that helps.
Add cin.get() at the end of the main function, it waits for user input ( return key ) or you can use system("PAUSE") which I do not recommend because it uses more resources. Just giving you some options.
I have used cin.ignore, cin.ignore(cin.rdbuf()->in_avail() + 1), return 0, and system("Pause") the only one that has worked is system("Pause"). I don't like how it adds the extra line, is there anything else that might work?