如何声明宏定义的函数
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
请看下面:
搞定
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
相关文章推荐
- Window环境下配置React Native Android环境
- Xcode7.1中帮助文档(Documentation and API Reference)的位置以及自行安装帮助文档的方法
- Unity3D -- 保存数据到excel
- react基础教程
- 程序的版式
- Android Slide Menu相关
- IOS 推送(本地推送、远程推送、三方推送[极光推送])
- iOS_自动变高度的headerView
- Mybatis原理分析之六:数据源
- centos 本地dns配置
- hive的操作
- Java工具类之Apache的BeanUtils
- Redis笔记(八)Redis的持久化
- Oracle 12C ORA-65096: 公用用户名或角色名无效
- UDP发送中文
- 一段代码,求解数独(九宫格)游戏
- 懵懵懂懂开始学习Unity
- linux基本命令
- ReactJS入门学习一
- 第14周 项目3 - 是否二叉排序树?