Calling atexit

From: Kelvin Moss (km_jr_usenet_at_yahoo.com)
Date: 11/30/04


Date: 30 Nov 2004 03:19:40 -0800

Hi all,

The prototype for atexit is 'int atexit(void (*function)(void))';

If I have a function foo defined as
void foo(void)
{

}
then what is the correct way to register the handler -

atexit(&foo); // I think this one
OR
atexit(foo);
Any references to Standard would be appreciated.

Thanks,
Sharad



Relevant Pages

  • Incrementing in C
    ... Suppose I have a function foo: ... void foo(int x, int y) { ... printf(" %d ", y); ...
    (comp.lang.c)
  • Help in Java swings(internal Frame)
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)
  • [PATCH] get rid if __cpuinit and __cpuexit
    ... unsigned long action, void *hcpu) ... unsigned int cpu = hcpu; ... -static int __cpuinit ... __cpu_up(unsigned int cpu) ...
    (Linux-Kernel)
  • [PATCH,RFC 2.6.14 09/15] KGDB: SuperH-specific changes
    ... This adds basic support for KGDB on SuperH as well as adding some architecture ... -static int kgdb_uart_getchar ... -static void kgdb_uart_putchar ... * The command-line option can include a serial port specification ...
    (Linux-Kernel)
  • problem in java swings
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)