I'm playing around a little bit in c++ and I'm using the console. However, I need the console to stay open after my program finishes its run. What do I need to add to do this?
I'm playing around a little bit in c++ and I'm using the console. However, I need the console to stay open after my program finishes its run. What do I need to add to do this?
LOL...Tthantos and his FAQ.Originally Posted by Thantos
I checked the FAQ, here's another solution works well for windows console applications with C++... I'm not quite sure about its specifics but I'm pretty sure you need to include stdlib...
and have this before you return in main..Code:#include <stdlib.h>
Code:system("PAUSE");
my spider-sense be tingling.
Ron - SCU Math/CS Major
actually it would be better as:
But of course thats covered in the faq in which I quote:Code:#include <cstdlib>
And I give FAQ links for several reasons:Originally Posted by FAQ Entry
1) To remind people they are there
2) Because often they explain better than I can
3) Its faster and there is less chance of someone beating me
Try
Code:cin.get() or..... #include <conio.h> and getch()