Use of exit() function

后端 未结 13 1390
离开以前
离开以前 2020-11-30 23:34

I want to know how and when can I use the exit() function like the program in my book:

#include

void main()
{
    int goals;
            


        
13条回答
  •  自闭症患者
    2020-11-30 23:52

    In addition to return an exit code to parent process -

    In UNIX, an important aspect that I think has been left out is, that exit() at first calls (in reverse order) all those functions, which were registered by atexit() call.

    Please refer to SUSv4 for details.

提交回复
热议问题