Turbo C atexit function.

Greg Hinton hinton at netcom.UUCP
Tue Jun 20 03:49:09 AEST 1989


In article <166 at enuxha.eas.asu.edu> hocker at enuxha.eas.asu.edu (Charles C. Hocker) writes:
>	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....
>....
>
>atexit_t exit_fn1 (void)
>....
>
>atexit_t exit_fn2 (void)
>....
>
>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

This example is taken verbatim from pp. 47-48 of the Reference Manual.

The bug is in the manual, not the compiler or libraries!  Change the type of
exit_fn1() & exit_fn2() to void & all will be well!



More information about the Comp.lang.c mailing list