Beginner , need help

So I am just beginning using c++..im learning through a c++ game programming book...and so i just finished chapter one, and now i want to create me little own text based adventure. So i made the script and it was all good...(also im using visual studio 2010) but when i debugged it and then ran the program, it would just close when i would hit the story part..i was using std::endl too...i dont know why it is closing out, anyone know?
Use keys Ctrl + F5 to run the program
closed account (Dy7SLyTq)
endl wouldnt keep it open
closed account (N36fSL3A)
Try adding
1
2
std::cin.get();
std::cin.ignore();
at the end.
Last edited on by Fredbill30
closed account (Dy7SLyTq)
expanding on freds example:
1
2
3
4
using std::cin;
cin.flush(); //just in case there is stuff in the buffer already
cin.get(); //wait for the user to press enter
cin.ignore(); //i can never remember what this does but sure 
Ctrl + f5 works, but then when i run the application in my project directory, it will just close out
Thank you Fred, that fixed my problem!
Have a look at the "console closing down" sticky thread in the beginners section(the last post , ofcourse)
Topic archived. No new replies allowed.