1,C++ 全局构造函数
2,,Linux下C
#include <stdio.h>
void before() __attribute__((constructor));
void after() __attribute__((destructor));
void before() {
printf("this is function %s\n",__func__);
return;
}
void after(){
printf("this is function %s\n",__func__);
return;
}
int main(){
printf("this is function %s\n",__func__);
return 0;
}