C Reference function abort()

This function of stdlib will abort the current process.

Usage of abort():

void abort ( void );

The function aborts the process with an abnormal program termination.
The function abort will generate a signal SIGABRT. This signal will by default causes the program to terminate.



Return value:


Source code example of abort():


	int main ()
		FILE * ptr_file;
		ptr_file= fopen ("somefile.txt","r");

		if (ptr_file == NULL)
			fputs ("error opening file\n",stderr);

		fclose (ptr_file);
		return 0;

This entry was posted in C Reference stdlib.h Functions. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed. Tweet This! Tweet This! or use to share this post with others.

Comments are closed.