By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,133 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,133 IT Pros & Developers. It's quick & easy.

cmd window closes

P: n/a
wax
Hello.

I am using Dev-C++ compiler.
After compile and run the cmd window is not staying open. The programe runs
but the window closes imidiatly.
I s the re any code line that i nedd to modify so i can see the results?

Thanks
Dec 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

wax napsal:
Hello.

I am using Dev-C++ compiler.
After compile and run the cmd window is not staying open. The programe runs
but the window closes imidiatly.
I s the re any code line that i nedd to modify so i can see the results?

Thanks
Something like

getc();
getc();

Dec 18 '06 #2

P: n/a
wax wrote:
Hello.

I am using Dev-C++ compiler.
After compile and run the cmd window is not staying open. The programe runs
but the window closes imidiatly.
I s the re any code line that i nedd to modify so i can see the results?

Thanks

Your answer is here:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

However, put the following at the end of main:

std::string trash;
std::getline(cin, trash);
Dec 18 '06 #3

P: n/a
red floyd wrote:
wax wrote:
>Hello.

I am using Dev-C++ compiler.
After compile and run the cmd window is not staying open. The programe
runs but the window closes imidiatly.
I s the re any code line that i nedd to modify so i can see the results?

Thanks


Your answer is here:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

However, put the following at the end of main:

std::string trash;
std::getline(cin, trash);
What's wrong with std::cin.get(); ? IIRC...

--
WW aka Attila
:::
Usenet is like a herd of performing elephants with diarrhea - massive,
difficult to redirect, awe-inspiring, entertaining, and a source of mind -
boggling amounts of excrement when you least expect it. - Gene
Spafford,1992
Dec 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.