#和##用法
来源:互联网 发布:matlab迭代求解算法GS 编辑:程序博客网 时间:2024/04/30 11:07
/********************************************* *关于#和##的特殊用法:在宏定义中,使用前缀#, *宏展开时 ,会把修饰的符号自动在两边加上双引号 *把它展开为字符串,而##则是把两端的符号连接起 *来,但是不会继续展开为字符串,eg如下所示 ********************************************/#include <stdio.h>#define printf_x(x) printf(#x"=%s\n",#x);#define sort(x) Sort ## xvoid Sort0(){printf("sort0");}void Sort1(){printf("sort1");}void Sort2(){printf("sort2");}void Sort3(){printf("sort3");}void Sort4(){printf("sort4");}int main(int argc, char *argv[]){/* #h号示例 */printf_x(doyouknow?);/* ##号示例 */sort(4)();return 0;}
结果图:
- #和##用法
- #和##用法
- performSelector用法和cancelPreviousPerformRequestsWithTarget用法
- UISlider用法和UIProgressView用法
- showModalDialog()和showModelessDialog()用法
- java_Hashtable和Enumeration用法
- SendMessage和Findwindow用法
- Log4配置和用法
- #和##的用法
- showModalDialog和showModelessDialog用法
- assert用法和NaN
- showModalDialog和showModelessDialog用法
- PCTFREE和PCTUSED用法
- SQLLDR用法和疑惑!
- showModalDialog和showModelessDialog用法
- showModalDialog和showModelessDialog用法
- Virtual和 Override用法
- MultiByteToWideChar和WideCharToMultiByte用法
- Lotus Notes 数据库中附件的批量导出
- Davinci-H.264 I帧和IDR帧的区别
- QT中文教程-----QT教程网络指南
- 黑马程序员--(HTML)HTML简介
- showModalDialog 访问父窗口,向父窗口返回值及undefined类型判断,js触发服务器控件事件
- #和##用法
- 再谈PN学习 .
- tomcat日志访问阀
- Android学习及如何利用android来赚钱
- Python Interface Syntax
- Linux环境变量的设置和查看方法
- Linux CPU信息查看
- TWaver HTML5 on Microsoft Surface RT
- awk学习笔记