Run window query

I have been testing my compiler (Bloodshed) by inserting simple programs (cout), and I find that the run window closes too quickly for me to view the results. I am not very familiar with compilers, and I was wondering if there was any way I could remedy this. Is there some setting that I can choose so I can manually close the run window, or is this issue arising from the brevity of the code itself?

Thank you.
Greetings.

I have looked through that thread before, and for some reason none of the suggestions are working. Might there be something wrong about my compiler?
Most if not all of those should work with that particular compiler. You must be doing it wrong.
Hello Helios,

Thank you for the advice, I am very new to C++ and am probably missing something without knowing it.

Would you mind supplying me a very simple example that would and should work?
1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;

int main(void)
{
	cin.ignore();
	return(0);
}
The simplest one, but which I personally don't recommend, is
1
2
3
4
5
6
#include <cstdlib>

int main(){
    //...
    system("pause");
}


A better one is
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <climits>

struct Stop{
    ~Stop(){
        std::cout <<"Press enter to continue"<<std::endl;
        std::cin.ignore(INT_MAX,'\n');
        std::cin.get();
    }
} stop_at_end;

//... 
You may notice that you have to press enter twice if there was no input.

But my favorite is to not use any of this and to just run the program from the console, as it was meant to be.
Thank you! It works now.
Topic archived. No new replies allowed.