惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
V
Visual Studio Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园 - 聂微东
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
博客园 - 司徒正美
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏

博客园 - Cheney Shen

如果将 macOS Mojave 降级为 macOS Sierra 或者更低版本 pip源提示“not a trusted or secure host” 解决 Window系统下MongoDB安装及远程访问 Windows下安装appium桌面版和命令行版 Command 'java' not found during running appium sudo npm install -g cnpm --registry=https://registry.npm.taobao.org Pycharm 中错误ImportError: No module named appium CURL并发测试POST和DELETE请求 curl如何发起DELETE/PUT请求?(备忘) Ubuntu 11.10下安装配置Zend Studio 9.0破解版详细步骤 iphone开源汇总(转) iphone开源汇总(转) python中的cursor[备忘] Intel苹果电脑Mac+Win+Linux多重系统启动(+公用分区)终极解决方案(备忘) IGT笔试题,正整数N等于M个不同的正整数之和的问题 如何通过一个结构体成员变量的地址找到该结构体的首地址?[备忘] 为特定应用程序关闭恢复窗口功能 [Mac OS X Lion][转] System Events, Key Code and Keystroke from Doug's AppleScripts Mac下Perl脚本如何运行
在main函数执行之前和执行之后执行的方法
Cheney Shen · 2011-10-30 · via 博客园 - Cheney Shen

//

//  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;

}