Anyone that uses bloodshed DevC++ Please help

Started by
7 comments, last by adampunk 20 years ago
I downloaded the newest compiler from bloodshev and I tried to learn a few things. Well I got to a few tutorials and was at a tutorial using key input ( CIN ). My question is, why is it when I hit enter to input an integer, my program ends? If you know of any other good compilers I would appreciate it. thanks.
Advertisement
try adding the line "system "PAUSE";" so it looks like this

int main()
{
\\whatever you put

system "PAUSE";
return 0;
}

that should do it
oops my bad. I ment

int main()
{
\\whatever you put

system ("PAUSE";
return 0;
}

really sorry
DANG. it read it wrong. just put parenthesis around the "PAUSE"
there is a reason why they named it bloodshed C++ :D
Thanks a ton man I''ve been so pissed about that one for like a month so I finally decided I needed to get back to that. Do you know if this code needs to be used for every compiler or just this one?
quote:Original post by adampunk
Thanks a ton man I''ve been so pissed about that one for like a month so I finally decided I needed to get back to that. Do you know if this code needs to be used for every compiler or just this one?


every, C++ is a language not compiler specific, and i like Dev-C++ over any microsoft compiler, becasue its based off of gcc which makes it more compatible with linux.


Sharp Basic - Coming summer 2004!
Sign Up For Sharp Basic Beta Testing!!!
I only know of DEV C++ needing it, but there are probably others too
It''s not a solution, it''s a hack.

Dev-C++ spawns your application from within the IDE and lets it run plain. MSVC, on the other hand, wraps any spawned applications in a bit of shell code that generates an effect equivalent to system("PAUSE"); without your code having to be soiled by such filth.

If you run your application from the console, you''ll see "Press a key to continue" when you''re done, which is a minor annoyance. More dangerous is the fact that system relies on your path, so if I were a malicious person and somehow able to install a program named pause.exe on your path, I could cause anything I wanted to happen when your program exited.

I''d recommend that you email Bloodshed and suggest to them that they fix this missing feature. Or switch to a free IDE that already does that.

This topic is closed to new replies.

Advertisement