Turbo C atexit function.

Doug Gwyn gwyn at smoke.BRL.MIL
Mon Jun 19 10:13:10 AEST 1989


In article <166 at enuxha.eas.asu.edu> hocker at enuxha.eas.asu.edu (Charles C. Hocker) writes:
>atexit_t exit_fn1 (void)
>{
> [...]
>main ()
>{
>  /* posting exit_fn1 */
>  atexit (exit_fn1);
> [...]
>   Type mismatch in parameter 'func' in call to 'atexit' in function main

I don't know what atexit_t is supposed to be (it's not part of the C
Standard), but I suspect your problem lies in using it for the function
return type.  Functions registered via atexit() have void return type.
Try changing atexit_t to void in your test program.

Also note that you're supposed to return an explicit value for the
result of main(); 0 would be a good one.



More information about the Comp.lang.c mailing list