Jump to content
  • Advertisement
Sign in to follow this  
one mind

Siimple c question

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

Hi, could someone please tell me what function pauses a console program to stop it from dissapearing at the end. Is it readln() or something like that? Thanks :)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by one mind
Hi Drew,
Thanks but i dont think that is c. I get a compiler error as it doesn't recognize system.


system() is a standard C function... Your OS may not have a pause command/program, though.

You need to #include <stdlib.h>

Share this post


Link to post
Share on other sites
It's really bad form, anyway. Console programs are meant to be run from the console and should close when they're finished.

Share this post


Link to post
Share on other sites
Thanks guys
System(pause) works nicely

Quote:
It's really bad form, anyway. Console programs are meant to be run from the console and should close when they're finished.


Programs are supposed to run the way you want them to :)

Share this post


Link to post
Share on other sites
Quote:
Original post by one mind
Programs are supposed to run the way you want them to :)


The proper way to do it is to create a batch file that runs your program and then calls pause.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!