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

前端 未结 11 1823
时光取名叫无心
时光取名叫无心 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:22

    exit(0) behave like return 0 in main() function, exit(1) behave like return 1. The standard is, that main function return 0, if program ended successfully while non-zero value means that program was terminated with some kind of error.

提交回复
热议问题