#include<stdio.h>
void __attribute__( (constructor) ) display()
{
printf("hello world!/n");
}
void __attribute__((destructor)) print()
{
printf("exit /n");
}
int main()
{
printf("OK /n");
return 0;
}
[root@localhost att]# gcc test.c
[root@localhost att]# ./a.out
hello world!
OK
exit