What's the differences between exit(0), exit(1) and exit(-1)?
dhruv_arora 5 Junior Poster
Recommended Answers
Jump to PostThe paramarater is the value that the program will return to the operating system so that other programs can use it for some purpose. The value 0 traditionally means the program exits normally without error. Any other value would mean the program encountered some kind of error. The value of …
Jump to Post
Exit(0)
, is commonly used as a successful exit message. Usually, you don't use it, use insteadReturn 0;
Exit(1)
Is used to reference some kind of abnormal program termination.
All 5 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
ndeniche 402 Posting Virtuoso Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
ndeniche 402 Posting Virtuoso Featured Poster
dhruv_arora 5 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.