PellesC is a c99/c11 C compiler.
#include <stdio.h>
#include <stdlib.h>
static void initialize(void);
static void finalize(void);
#pragma startup initialize()
#pragma exit finalize()
static void finalize(void)
{
printf( "finalize\n");
}
static void initialize(void)
{
printf( "initialize\n");
atexit( finalize);
}
int main( int argc, char** argv)
{
printf( "main\n");
return 0;
}
output:initialize
main
finalize
finalize
Press any key to continue...