在main函数执行之前执行操作

#include <stdio.h>

struct exec_before_main{
    exec_before_main(){
        printf("before main.\n");
    }
};
static exec_before_main t;

int main() {
    printf("start main.\n");
    return 0;
}

posted @ 2022-04-19 18:16  enbug  阅读(35)  评论(0)    收藏  举报