//
// before&after.c
// Created by labuser on 10/30/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#include <stdio.h>
void before() __attribute__((constructor));
void after() __attribute__((destructor));
void before() {
//printf("This is function %s\n", __func__);
fprintf(stdout, "In %s %d\n", __func__, __LINE__);
}
void after() {
//printf("This is function %s\n", __func__);
fprintf(stdout, "In %s %d\n", __func__, __LINE__);
}
int main(int argc, char* argv[]) {
atexit(after);
printf("This is function %s\n", __func__);
return 0;
}