• Advertisement

Archived

This topic is now archived and is closed to further replies.

Anyone that uses bloodshed DevC++ Please help

This topic is 5040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
try adding the line "system "PAUSE";" so it looks like this

int main()
{
\\whatever you put

system "PAUSE";
return 0;
}

that should do it

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
oops my bad. I ment

int main()
{
\\whatever you put

system ("PAUSE";
return 0;
}

really sorry

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
DANG. it read it wrong. just put parenthesis around the "PAUSE"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
there is a reason why they named it bloodshed C++ :D

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I only know of DEV C++ needing it, but there are probably others too

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement