Insert Function before and after main function
2013-08-23 22:50
309 查看
Source code:
Just compile the source code, and run, you will find the interesting result.
#include<stdio.h>
void myStartupFun (void) __attribute__ ((constructor));
void myCleanupFun (void) __attribute__ ((destructor));
/* implementation of myStartupFun */
void myStartupFun (void)
{
printf ("startup code before main()\n");
}
/* implementation of myCleanupFun */
void myCleanupFun (void)
{
printf ("cleanup code after main()\n");
}
int main (void)
{
printf ("hello\n");
return 0;
}
Just compile the source code, and run, you will find the interesting result.
相关文章推荐
- Functions that are executed before and after main() in C
- CRT code before and after main
- CRT code before and after main
- How to call javascript function after validation and before a postback
- Ubuntu GCC 编译C++ 文件出错。main.o: In function `__static_initialization_and_destruction_0':
- Before, after, each row and table level triggers [Oracle]
- 【笔记】after,before,insertAfter,insertBefore的作用
- it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping>
- 363. Praise goes before, and shame comes after. 骄傲使人落后
- Animation.setFillAfter and Animation.setFillBefore的作用
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver
- EF 新增数据时提示it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element
- Oracle Trigger :Before,after,each row and table level triggers ORA-04082 ORA-04084
- Animation.setFillAfter and Animation.setFillBefore的作用
- it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element
- js insertBefore insertAfter appendChild
- it has a DefiningQuery and no InsertFunction element exists in the ModificationFunctionMapping element to support the current op
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver
- How to construct/destruct before/after main()