Jump to content
  • Advertisement

Archived

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

ThomasSauder

DevC++ users

This topic is 5385 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

Hey, in Visual C++, when i run a program, it says "press any key to continue". In DevC++ , the program flashes and I forgot how to make it wait until a key is pressed... So there''s the easy question :D

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Nervo
try

system("PAUSE");

in main()


That is the primary way, but there are several more.
 char x;
cin>>x;

or
include and use sleep() for a few seconds.

Share this post


Link to post
Share on other sites
system("PAUSE") is not standard c++ and devc++ does not include this.

in dos use getchar to wait till a key is pressed at the end of your prog this will keep the consol up till you press a key

Share this post


Link to post
Share on other sites
quote:
Original post by Vermillion
system("PAUSE") is not standard c++ and devc++ does not include this.

in dos use getchar to wait till a key is pressed at the end of your prog this will keep the consol up till you press a key


Um, what? "system()" is a standard Win32 function, and, being a Win32 compiler, MinGW(the compliler for Dev-C++) includes it in windows.h.

Share this post


Link to post
Share on other sites
quote:
Original post by sSimontis
quote:
Original post by Nervo
try

system("PAUSE");

in main()


That is the primary way, but there are several more.
 char x;
cin>>x;

or
include and use sleep() for a few seconds.


Did I say there aren''t more?

Share this post


Link to post
Share on other sites
quote:
Original post by cowsarenotevil
quote:
Original post by Nervo
Did I say there aren''t more?


Did he say you said there aren''t more? By the way, I use getch/getchar.


Did I ask your opinion?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!