哪些函数可以在main函数之前执行 Nikola_Jokic 2023-12-28 68 阅读1分钟 __attribute((constructor)) __attribute((constructor))修饰的函数在main函数之前执行 __attribute((constructor)) void func1() { printf("func1\n"); } 全局static变量的初始化 int func2() { printf("func2\n"); return 0; } static int n = func2()