标准C支持可变参数的函数,意味着函数的参数是不固定的,例如printf()函数的原型为:int printf( const char *format [, argument]... )

而在GNU C中,宏也可以接受可变数目的参数,例如:

#define DM9000_DBG(fmt,args...) printf(fmt, ##args)

这里args 表示其余的参数可以是零个或多个,这些参数以及参数之间的逗号构成arg 的值,在宏扩展时替换arg,例如下列代码:

DM9000_DBG("\n");

DM9000_DBG("NCR (0x00): %02x\n", DM9000_ior());

DM9000_DBG("rx status: 0x%04x rx len: %d\n", RxStatus, RxLen);

会被扩展为:

printf ("\n");

printf ("NCR   (0x00): %02x\n", DM9000_ior());

printf ("rx status: 0x%04x rx len: %d\n", RxStatus, RxLen);

18.3 #define DM9000_DBG(fmt,args...) printf(fmt, ##args)代表什么的更多相关文章

  1. go语言笔记——包的概念本质上和java是一样的,通过大小写来区分private,fmt的Printf不就是嘛!

    示例 4.1 hello_world.go package main import "fmt" func main() { fmt.Println("hello, wor ...

  2. Java中main函数参数String args[] 和 String[] args 区别

    其实没什么区别的:当初我也是这样的疑问,呵呵:非要说区别就看下面:执行效果上没有不同, 但在语法意义上略有不同. 比如, String与String[], 前者叫字符串类型而后者叫字符串数组类型. S ...

  3. String args[] 和 String[] args 有什么区别

    String args[] 和 String[] args 有什么区别 public static void main(String args[]) 或 public static void main ...

  4. java中public static void main(String[] args)中String[] args代表什么意思?

    这是java程序的入口地址,java虚拟机运行程序的时候首先找的就是main方法.跟C语言里面的main()函数的作用是一样的.只有有main()方法的java程序才能够被java虚拟机欲行,可理解为 ...

  5. String... args 和 String[] args 的区别

    public static void main(String[] args) { callMe1(new String[] { "a", "b", " ...

  6. debug(fmt,args...)调试

    1.定义宏(debug.h) #ifndef __DEBUG__H #define __DEBUG__H #include <stdio.h> #ifdef DEBUG #define d ...

  7. __attribute__((format(printf, a, b)))

    最近,在看libevent源码,第一次看到__attribute__((format(printf, a, b)))这种写法.因此,在这里记录下用法. 功能:__attribute__ format属 ...

  8. Linux 下获取LAN中指定IP的网卡的MAC(物理地址)

    // all.h// 2005/06/20,a.m. wenxy #ifndef _ALL_H#define _ALL_H #include <memory.h>#include < ...

  9. Linux下hp打印机驱动hplip分析

    Hplip分析 版本号是2.14,源代码位置:http://hplipopensource.com. 图的来源:http://hplipopensource.com/node/128. 实践中使用的打 ...

随机推荐

  1. WordPress上传到互联网搭建

    1.建站流程: 1.购买域名 2.购买空间 3.解析绑定 4.上传安装 2.购买域名 域名的购买可以到相关域名出售的服务商那儿买,如阿里云,主机庙.这里就不做详细解释了 3.购买空间 域名的购买可以到 ...

  2. 把腾讯视频嵌入到html中

    ---------------------------------------------------------------------------------------------------- ...

  3. [python]python2与python3版本的区别

    python2和python3的区别 区别: print函数 整数相除 Unicode 异常处理 xrange map函数 不支持has_key print函数: Python 2: print是语句 ...

  4. (18)ProcessPoolExecutor进程池

    # 新版本的进程池 ProcessPoolExecutor # 实例化进程池 ProcessPoolExcutor(cpu_count) # 异步提交任务 submit / map # 阻塞直到任务完 ...

  5. start-dfs.sh 启动成功 datanode未启动

    在namenode中启动报错 test2: Exception in thread "main" java.net.UnknownHostException: unknown ho ...

  6. mpvue构建小程序(步骤+地址)

    mpvue 是一个使用 Vue.js 开发小程序的前端框架(美团的开源项目).框架基于 Vue.js 核心,mpvue 修改了 Vue.js 的 runtime 和 compiler 实现,使其可以运 ...

  7. day042 css 选择器

    css(Cascading Style Sheet) 层叠样式表,定义了如何显示HTML元素,给HTML设置样式,让它看起来更好 一.css语法 css样式包括两部门,选择器(给谁的样式)和声明(什么 ...

  8. 『TensorFlow』读书笔记_Inception_V3_下

    极为庞大的网络结构,不过下一节的ResNet也不小 线性的组成,结构大体如下: 常规卷积部分->Inception模块组1->Inception模块组2->Inception模块组3 ...

  9. PAT 1065 A+B and C (64bit)

    1065 A+B and C (64bit) (20 分)   Given three integers A, B and C in [−], you are supposed to tell whe ...

  10. mysql 主从配置,主-》windows,从-》centos6.5

    1.虚拟机配置的主从关系.win7 ip地址192.168.52.102,虚拟机ip 192.168.184.128.docs进入主服务器(master)mysql目录下,添加用户,然后执行mysql ...