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

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

    exit is a system call used to finish a running process from which it is called. The parameter to exit is used to inform the parent process about the status of child process. So, exit(0) can be used (and often used) to indicate successful execution of a process and exit(1) to flag an error. reference link

提交回复
热议问题