• Announcements

Archived

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

I need help with C/C++

Recommended Posts

I use Bloodshed Dev-C++, and none of the pause ideas have worked for me!!" Does anyone have a clue to make my game pause about a minute before exiting? I was told not to use system("pause"); so what do I use? Remember, I use Dev-C++, not VC++ or anyhting like that. ***************Main Menu********************** * 1. Say hi at cia007techie@home.com * * 2. Visit Josh at www.joshworks.freehomepage.com * * 3. Exit * ********************************************* cin>>choice;

Share on other sites
are you compiling a windows app or a (DOS) console app?
you might try Sleep(5000) to pause for 5 secounds if you are in windows (meaning you have included windows.h) if not, I believe the function is the same, but without the capital "S", so it becomes sleep(5000) or something like that, what GCC does Bloodshed uses? djgpp or mingw32? mingw32 comes with windows headers if you got all the files you need (w32api.tar.gz)

Hope that helps

Share on other sites
It uses Mingw. I am in console, and Ive tried that.

* 1. Say hi at cia007techie@home.com *
* 2. Visit Josh at www.joshworks.freehomepage.com *
* 3. Exit *
*********************************************
cin>>choice;

Share on other sites
Kwizatz, DevC++ uses MinGW32 by default, and Cygwin if you want it to.

Have you tried a simple "getchar()" at the end of your program (in stdio.h)?

[Resist Windows XP''s Invasive Production Activation Technology!]

Share on other sites
There should be better ways of doing it than this, but here''s one way that should be platform-independent etc...

  #include time_t now;time_t one_minute;time(&now);one_minute = now + 60;while (one_minute > time(NULL)) ;

I can''t see why you''d want to do this, though

• Forum Statistics

• Total Topics
627736
• Total Posts
2978866

• 10
• 10
• 21
• 14
• 12