Skip to content
Related Articles
Open in App
Not now

Related Articles

quick_exit() function in C++ with Examples

Improve Article
Save Article
  • Last Updated : 14 Mar, 2023
Improve Article
Save Article

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++: Example:- 


// c++ program to demonstrate
// example of quick_exit() function.
#include <bits/stdc++.h>
using namespace std;
void function1()
    cout << "Exit Function 1" << endl;
void function2()
    cout << "Exit Function 2" << endl;
int main()
    // registering function
    return 0;


Exit Function 2
Exit Function 1
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!