What is the difference between exit(0) and exit(1) in C?

前端 未结 11 1824
时光取名叫无心
时光取名叫无心 2020-12-22 17:19

Can anyone tell me? What is the difference between exit(0) and exit(1) in C language?

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 18:20

    When the executable ends (exits) it returns a value to the shell that ran it. exit(0) usually indicates that all is well, whilst exit(1) indicates that something has gone amiss.

提交回复
热议问题