If you are having trouble with your C++ programs opening and closing really fast, here's a quick fix. Add the following code to the end of your main function:
This will cause the console window to wait for input before it closes. I recommend people avoid the use of system("PAUSE") for several reasons. As for some explanation as to why, look at this website:
Though this may seem like an obvious thing to do, many many beginners always ask me how to do this.