您的位置:首页 > 其它

如何声明宏定义的函数

2015-12-16 18:22 190 查看
如何声明宏定义的函数:

请看下面:

搞定
dd.c 中
#include <stdio.h>

#define CTOR(type)              \
void type##Setting()            \
{                               \
    printf("%s\n","sss");       \
}

CTOR(type);
dd.h 中
#define CTOR(type)  \
void type##Setting();
然后主函数 demo.c中
#include "dd.h"

extern CTOR(type)

int main()
{
   typeSetting();

   return(0);
}

http://bbs.bccn.net/thread-285907-1-1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: