_Exit: exit program without closing files : Exit 2 « stdlib.h « C / ANSI-C






_Exit: exit program without closing files


    

//Declaration:  void _Exit(int exit_code); 

    
  

  #include <stdlib.h>
  #include <stdio.h>

  int main(void)
  {
    char choice;

    do {
      printf("Quit (Q)\n");
      choice = getchar();
    } while(!strchr("Q", toupper(choice)));

    if(choice=='Q'){
       _Exit(0);
    }

    return choice;
  }

           
       








Related examples in the same category