|
|
abort() - Utility Function
|
Tutorials

Cpp

|
Topic |
How is Utility function "abort()" used in C++?
How to Abort the program using c++?
|
|
Explanation |
|
abort() is a Utility Function that abort(terminate) the program execution immediately. It will return
an implementation defined value to the calling process, in environments that support this function otherwise never returns to the
calling program.
Syntax:
void abort(void);
Example:
#include <stdlib.h>
#include <stdio.h>
int main()
{
printf("The program will get aborted");
abort();
}
|
Result:
The program will get aborted
Abnormal program termination
In the above example abort() terminates the program and returns an implementation defined value.
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|