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

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

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

11条回答
  •  旧时难觅i
    2020-12-22 18:05

    exit function. In the C Programming Language, the exit function calls all functions registered with at exit and terminates the program.

    exit(1) means program(process) terminate unsuccessfully. File buffers are flushed, streams are closed, and temporary files are deleted

    exit(0) means Program(Process) terminate successfully.

提交回复
热议问题