differencein exit(0),exit(1)and exit(-1)

Home Forums C Programming differencein exit(0),exit(1)and exit(-1)

This topic contains 1 reply, has 2 voices, and was last updated by  dham ampatuan 11 years, 1 month ago.

  • Author
    Posts
  • #1952

    yavatever
    Member

    please tell me difference between the exit(0),exit(1)and exit(-1) stored in stdlib.h header file in C .

  • #3209

    @alok wrote:

    please tell me difference between the exit(0), exit(1) and exit(-1) stored in stdlib.h header file in C .

    Exit codes tell the operating system about the exit status of the program you’re executing.exit(0) represents successful execution and termination of the program.exit(1) represents general errors like divide by zero etc.exit(-1) represents unsuccessful execution.Google around a bit for more details.

You must be logged in to reply to this topic.