-
windows console probs
i am trying to program stuff, and whenever i run it on my compiler(borland), my console window pops up and down. looked in faq, it couldn't really help me. maybe someone could help me out by telling me how to change directory from a C: prompt, when i try to put in a "please press enter to continue..." type code, my console disapears. help.
thanx
-
You can use something like this:
cout<<"Please hit a key to continue."<<endl;
cin.get();
See the faq here:
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
As for why that happens, see here:
http://forums.devshed.com/t60302/s86...f92edf3c7.html
-
Use getch() just before you exit main().
-
Wow!
Henroid, a long time back, I had posted this same querry on this very board.
And I am passing to you the reply given to me,hoping that someday,you too will give this reply to a novice C++ programmer and save his/her day.
Simple, ethier type
std::cin.get();
std::cin.get();
before the "return 0;" in int main()
Or, type
std::cin.ignore();
std::cin.get();
before return 0; in int main()