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

Viewing 1 reply thread
  • Author
    Posts
    • #1952
      yavatever
      Participant

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

    • #3209
      dham ampatuan
      Participant

      @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.

Viewing 1 reply thread
  • The forum ‘C Programming’ is closed to new topics and replies.