Use of exit() function

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

    Try man exit.


    Oh, and:

    #include 
    
    int main(void) {
      /*  ...  */
      if (error_occured) {
        return (EXIT_FAILURE);
      }
      /*  ...  */
      return (EXIT_SUCCESS);
    }
    

提交回复
热议问题