测试宏定义#

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>

#define Conn(x,y)   x##y
#define ToString(x) #x
int main(void)
{
   int ARR[4] = {192,168,2,34};
   int ARR9 = 99;
   printf("%s\r\n",ToString(ARR[0]));//打印:ARR[0]
   //printf("%s",Conn(ARR,ARR) );//error: 'ARRARR' was not declared in this scope
   //printf("%d",Conn(ARR,[0]) );//error: pasting "ARR" and "[" does not give a valid preprocessing
   printf("%d\r\n",Conn(ARR,9) );//99
   //printf("%s\r\n",Conn("ARR","9") );//error: pasting ""ARR"" and ""9"" does not give a valid preprocessing
   return(0);
}

是一种反向的感觉

反弹琵琶

 

+++++++++++++++++++++++补充+++++++++++++++

http://blog.chinaunix.net/uid-26189153-id-2380621.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值