- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between exit(0) and exit(1)
In this post, we will understand the difference between exit(0) and exit(1).
It is portable.
It tells about the successful termination or completion of the program.
It tells about the termination when the program is executed without any errors.
The ‘EXIT_SUCCESS’ macro is used to return code 0.
The ‘EXIT_SUCCESS’ can be defined as standard as zero.
It is not portable.
It tells about the abnormal termination of the program.
It tells about the termination if the program exited with certain error when the program was being executed.
The ‘EXIT_FAILURE’ macro is used to return code 1.
It is not restrict by standard to be 1 only.
It can be used based on how the system implements it.
- Related Articles
- exit() function in PHP
- Node.js – process ‘exit’ Event
- exit(), abort() and assert() in C/C++
- Python Program Exit handlers (atexit)
- Exit Methods in C# Application
- exit() vs _Exit() function in C and C++
- exit() vs _Exit() in C/C++
- How to exit iPhone application gracefully?
- return statement vs exit() in main() C++
- What is exit() function in C language?
- Disable Exit (or [ X ]) in Tkinter Window
- How to exit a process in Node.js?
- What are the differences in die() and exit() in PHP?
- How to exit from a Python if clause?
- What are Maandana paintings? Do they still exit?