Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Dev-C++ to develop some console apps to study. When my program tries to run


ZA stops it and asks me to allow or deny it. I check the "always" box but it seems that every time I compile it, it generates a new exe file so every time I run it ZA pops up.

Of course the simplest solution is to disable it or deal with it :-P but I'm not eager for any of both. Any suggestions? thanks in advance!

share|improve this question
Don't use system("pause"), use getchar(). Or better, don't use any 'press any key...' commands: run your program from a proper CMD.EXE box. – Renan Sep 4 '12 at 3:26
The reason ZA cannot remember your selection is because you are changing the application signature each time you compile it. My suggest generate a expection for the folder the .exe is being run in. – Ramhound Sep 4 '12 at 13:31
@Ramhound That's what I was aiming for with my question! Do you know how to do dat? – rMaero Sep 4 '12 at 17:04

Get rid of system("PAUSE"). If you want to wait for a keypress, use sensible C or C++ code to do that. Don't launch a process.

Also, console applications should never wait for a keypress at the end of their run. Among other things, this makes them unusable in pipelines. If you need the output of a console application after it finishes running, you should run it from a console.

It's not the program's responsibility to ensure it's run in a sane environment. If run from a temporary console, its output will be temporary as it should be. Someone who didn't want that wouldn't run it from a temporary console.

This annoys people who know what they're doing (imagine if you redirect the program's output to a file, for example) and just facilitates people who don't know they're doing to continue to ask for things other than what they want, continuing the cycle of programmers giving them what they didn't ask for.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .