Turbo C atexit function.

Charles C. Hocker hocker at enuxha.eas.asu.edu
Fri Jun 16 07:50:24 AEST 1989


Hello,
	I am using Turbo C 2.0 and am having trouble getting the
atexit function to work.  I typed in the following program from the
Turbo C reference guide and could not get it to work.  Does anyone 
know of any bugs using this function?

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

atexit_t exit_fn1 (void)
{
  printf("Exit function 1 called\n");
}

atexit_t exit_fn2 (void)
{
  printf("Exit function 2 called\n");
}

main ()
{
  /* posting exit_fn1 */
  atexit (exit_fn1);

  /* posting exit_fn2 */
  atexit (exit_fn2);
  printf ("Main quitting...\n");
}

When the program is compiled the following error messages are given:
   Type mismatch in parameter 'func' in call to 'atexit' in function main

Any assistance will be appreciated.

				-Chuck   hocker at eas.asu.edu



More information about the Comp.lang.c mailing list