The exit () function in C
The void exit (int status) function immediately terminates the calling process. Any file opened by the process is closed and any child process is inherited by the initial process and the parent process is sent a SIGCHILD signal.
Declare the exit () function in C
Below is the declaration for exit () in C:
void exit ( int status )
Parameters
status : This is the status value returned to the parent process.
Returns the value
This function does not return any values.
For example
The following C program illustrates the usage of exit () in C:
#include #include int main () { printf ( "Bat dau thuc thi chuong trinh .n" ); printf ( "Thoat chuong trinh .n" ); exit ( 0 ); printf ( "Ket thuc chuong trinh .n" ); return ( 0 ); }
Compiling and running the above C program will result:
According to Tutorialspoint
Previous article: Function atexit () in C
Next lesson: Function getenv () in C
5 ★ | 1 Vote
You should read it
May be interested
- MAX function in SQL Serverthe article will explore and show you how to use the max function in sql server to find the maximum value in a set.
- How to log out of your Google account on devicesgoogle is now a popular account, when you can use gmail or other applications such as google drive, google docs, etc. through your google account.
- SUM function in SQL Serverthe sql server sum function returns the total value of a column, a data set, or an expression.
- The ord () function in Pythonthe built-in ord () function in python returns an integer representing the unicode code of the specified character.
- RIGHT function in SQL Serverthe article will explore and guide you how to use the right function in sql server to extract some characters from the right side of a given string.
- Int () function in Pythonthe int () function in python returns an integer object from any number or string.
- AVG function in SQL Serverthe avg function in sql server returns the average value of an expression or average value according to the specified column of the selected row.
- How to exit, logout Viber account on computers, laptopshow to exit, logout viber account on computers, laptops. viber is the popular ott (over the top) app on phones with millions of daily users. viber is one of the leading applications and names like zalo, whatsapp, messenger .. l
- Hex () function in Pythonthe hex () function is one of python's built-in functions, used to convert an integer into the corresponding hexadecimal form.
- ABS function in SQL Serverthis article will show you in detail how to use the abs () handling function in sql server with specific syntax and examples to better visualize and capture functions.