Difference between exit and exit(0)

I would just like to know that what is the difference between exit,exit(0) and exit(1).Please help me.

Replies

  • Vishal Sharma
    Vishal Sharma
    you'll have a better explanation here...
    #-Link-Snipped-#
  • Jeffrey Arulraj
    Jeffrey Arulraj
    exit needs one argument of type integer that means any number in the integer category can be sufficient for it
  • Vishal Sharma
    Vishal Sharma
    jeffrey samuel
    exit needs one argument of type integer that means any number in the integer category can be sufficient for it
    Not agreeing with your answer! PS the link above. you'll have the proper information about it 😀
  • sulochana anand
    sulochana anand
    exit and exit 0 or exit with non 0 numbers are used to terminate program.exit 0 is used to terminate without any error.but with nonzero it indicates eroors.for eg if u r trying to open file which is not exist in system then it may be indicated by some numbers like 1 etc.different types of eroor are indicated by diffrent numbers.
  • Aniruddha Varma
    Aniruddha Varma
    Not just the system, but even manually - you may put exit(1) into your code if you want to exit and also indicate an error to the OS.

    As I know it, most people just use exit(0) to mean that the program has terminated normally.

You are reading an archived discussion.

Related Posts

Hi, Could anybody suggest a brief explanation of .inc extension file. I want its main purpose compared with other extension files. 😉
i am a nigerian, a graduate in electronics and computer. still pushing forward to know more on electronics and computer. right now, i am a technologist in one of the...
some times i really think that taking Comp. Sc. as my stream of BE....restrict me in many ways specially when i compare it any other core branch.I mean i can't...
sir I want to create database on php. when i click on phpmyadmin in wamp server it giving following error it solve. Error MySQL said: #1045 - Access denied for...
Hi! guys could you please tell me how should I configure both the servers( IIS SERVER AND WAMP SERVER) at a time. I mean will I able to run both...