quick_exit() function in C++ with Examples
The quick_exit() function is defined in the stdlib header file. The quick_exit() function is used for normal termination of a process without completely cleaning the resources.
- If val is zero or EXIT_SUCCESS, it shows successful termination of program.
- If the value is non-zero or EXIT_FAILURE, it shows that the program is not successfully terminated. These functions are called in the reverse order of their calling.
void quick_exit(int val);
Parameter: This method takes a single parameter val which is an integral value that represent the exit status of a program. Return Value: This function doesn’t returns anything.
Time Complexity: O(1)
Auxiliary Space: O(1)
Below program illustrate the quick_exit() function in C++:
"Exit Function 1"
"Exit Function 2"
Exit Function 2
Exit Function 1
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!