Use of exit() function

后端 未结 13 1424
离开以前
离开以前 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:49

    The exit() function is a type of function with a return type without an argument. It's defined by the stdlib header file.

    You need to use ( exit(0) or exit(EXIT_SUCCESS)) or (exit(non-zero) or exit(EXIT_FAILURE) ).

提交回复
热议问题