I need help with C/C++

Started by
3 comments, last by Joshman 22 years, 10 months ago
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;
***************Main Menu*********************** 1. Say hi at cia007techie@home.com ** 2. Visit Josh at www.joshworks.freehomepage.com ** 3. Exit **********************************************cin>>choice;
Advertisement
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
It uses Mingw. I am in console, and Ive tried that.

***************Main Menu**********************
* 1. Say hi at cia007techie@home.com *
* 2. Visit Josh at www.joshworks.freehomepage.com *
* 3. Exit *
*********************************************
cin>>choice;
***************Main Menu*********************** 1. Say hi at cia007techie@home.com ** 2. Visit Josh at www.joshworks.freehomepage.com ** 3. Exit **********************************************cin>>choice;
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!]
There should be better ways of doing it than this, but here''s one way that should be platform-independent etc...

  #include <time.h>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

This topic is closed to new replies.

Advertisement