From: ern on
Right now I'm using exit(0) to [attemp to] terminate my program. My
program is a console .exe application. After the "exit(0)" line of
code is encountered, the console application waits for an enter press,
before terminating. I want it to terminate completely without having
to press enter manually. Anybody know what I might be missing here ?

From: Flash Gordon on
ern wrote:

<snip>

> if(result == EXIT_PROGRAM){
> printf("Exit script command detected.\n");
> exit(0); //Thought this line would exit, but it doesn't
> // It requires that you press enter after for console
> termination.
> }

It's probable that the application has ended but the IDE is being
helpful and keeping the command window open for you. Try running it
outside the IDE. As far as the C language is concerned the call to exit
is enough.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
From: ern on

pemo wrote:
> ern wrote:
> > Right now I'm using exit(0) to [attemp to] terminate my program. My
> > program is a console .exe application. After the "exit(0)" line of
> > code is encountered, the console application waits for an enter press,
> > before terminating. I want it to terminate completely without having
> > to press enter manually. Anybody know what I might be missing here ?
>
> Post a working sample of the code - then we might be able to help.
>
> --
> ==============
> *Not a pedant*
> ==============

if(result == EXIT_PROGRAM){
printf("Exit script command detected.\n");
exit(0); //Thought this line would exit, but it doesn't
// It requires that you press enter after for console
termination.
}

From: Default User on
ern wrote:

>
> Default User wrote:

> > Are you running this from an IDE, like Visual Studio or some such
> > thing?

> Visual C++ IDE

There you go. That's not a language thing, it's just the IDE. People
don't want that window disappearing, because you can't see the output.
You have to ask on a Visual Studion newsgroup of some sort whether that
can be changed. There's nothing C can do.



Brian

From: Default User on
ern wrote:

>
> pemo wrote:

> > Post a working sample of the code - then we might be able to help.

> if(result == EXIT_PROGRAM){
> printf("Exit script command detected.\n");
> exit(0); //Thought this line would exit, but it doesn't
> // It requires that you press enter after for console
> termination.
> }

As I said elsewhere, it's the IDE. Try running that from a command you
opened, you'll see the expected behavior.



Brian