_Exit - C stdlib.h

C examples for stdlib.h:_Exit

Type

function

From


<cstdlib>
<stdlib.h>

Description

Terminate calling process

Prototype

void _Exit (int status);
void _Exit (int status) noexcept;

Parameters

Parameter Description
status Status code.
  • If status is 0 or EXIT_SUCCESS, it indicates success.
  • If status is EXIT_FAILURE, it indicates failure.

Return Value

none.

Demo Code


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

int main ()// w w  w  .ja v a2 s.c  om
{
  FILE * pFile;
  pFile = fopen ("nonExist.cpp","r");
  if (pFile==NULL)
  {
    printf ("Error opening file");
    _Exit (EXIT_FAILURE);
  }
  return 0;
}

Related Tutorials