一道与预处理有关的题目
2012-07-21 20:53
260 查看
在看雪看到了刘涛涛出的一道题:http://bbs.pediy.com/showthread.php?t=130889
过去曾经做过类似的,这里再给个解释的资料:
The # operator has a similar difficulty, by the way. If #x appears in a replacement list, where x is a macro parameter, the corresponding argument is not expanded. Thus, if N is a macro representing 10, and STR(x) has the replacement list #x, expanding STR(N)
yields "N", not "10".
这样你就知道TEXT Macro为什么要这样#define了。
过去曾经做过类似的,这里再给个解释的资料:
The # operator has a similar difficulty, by the way. If #x appears in a replacement list, where x is a macro parameter, the corresponding argument is not expanded. Thus, if N is a macro representing 10, and STR(x) has the replacement list #x, expanding STR(N)
yields "N", not "10".
这样你就知道TEXT Macro为什么要这样#define了。
相关文章推荐
- 一道有关球赛队员分配的C++程序题目
- 解一道通过预处理来匹配字符串的题目
- 一道有关球赛队员分配的C++程序题目
- 有关逻辑判断 请问pascal一道NOIP题目
- 【预习笔记】一道很有趣的有关java类加载初始化的题目
- 一道有关图论的题目
- 一道有关球赛队员分配的C++程序题目
- Reverse Linked List以及一道有关倒序的题目
- 一道与死锁有关的题目
- 一道有关static的题目
- 一道有关static-extends题目
- 嵌入式系统一道中断有关题目
- 一道有关switch-case题目
- 一道容易出错的题目(有关负数的补码)
- 一道有关switch-case题目
- 一道有关hash的POJ题目:POJ1200 Crazy Search
- 一道面试题引发的有关随机数的思考(5)
- 另一道基础测试题目
- 关于static的一道题目和static 的小结
- 一道关于C++ 的面试题目(继承、构造函数以及析构函数)