www.delorie.com/djgpp/doc/libc-2.02/libc_48.html   search  
Go to the first, previous, next, last section, table of contents.


atexit

Syntax

#include <stdlib.h>

int atexit(void (*func)(void));

Description

This function places the specified function func on a list of functions to be called when exit is called. These functions are called as if a last-in-first-out queue is used, that is, the last function registered with atexit will be the first function called by exit.

At least 32 functions can be registered this way.

Return Value

Zero on success, non-zero on error.

Portability

ANSI, POSIX

Example

void exit_func()
{
  remove("file.tmp");
}

...
atexit(exit_func);
...


Go to the first, previous, next, last section, table of contents.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 1998   by DJ Delorie     Updated Dec 1998  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)