6.15 the exit function

Ace your homework & exams now with Quizwiz!

what file header must be used with an exit function?

<cstdlib>

why should we use exit function with caution?

because it shuts down your whole program.

when the exit function is called what happens?

it cause the program to stop regardless of which function contains the call.

a C++ program stops executing when the return statement in function main is encountered. when other functions end, however, the program does not stop. Control of the program goes back to the place immediately following the function call.

sometimes rare circumstances make it necessary to terminate a program in a function other than main. to do this we use the exit function.

exit (0) is what?

the exit function used inside a function to stop the program.

concept the exit function:

the exit() function cause a program to terminate, regardless of which function or control mechanism is executing.


Related study sets

Virginia Plan vs. New Jersey Plan

View Set

Unit 3: Lesson 2: Igneous Rocks Assessment, p. 74

View Set

Strategic Managemnet Chapter 13

View Set

Biology 2402 reproductive systems

View Set