代名符
来源:互联网 发布:知乎 现实 打怪 编辑:程序博客网 时间:2024/06/14 00:38
在 C++ 语言编程设计中常利用 #define 语句定义一类空的字符串代换技术, 被称为代名符定义.
代名符在程序中不起任何实际作用, 只能放在行首用来说明程序的设计者, 类的归属, 设计时间, 程序的分类或所处的总体位置等, 有助于读程序的信息. 如下所示:
另一个例子, 比如 MFC 程序的消息映射函数声明最前面的 afx_msg 也是代名符. afx_msg 定义在 afxwin.h 中, 如下:
摘自: 彭木根, 王淑凌. C++ STL程序员开发指南. 中国铁道出版社. 2003年4月: P6.
http://msdn.microsoft.com/en-us/library/k6tw900t.aspx
The afx_msg keyword suggests the effect of the C++ virtual keyword by distinguishing the handlers from other CWnd member functions. Note, however, that these functions are not actually virtual; they are instead implemented through message maps. Message maps depend solely on standard preprocessor macros, not on any extensions to the C++ language. The afx_msg keyword resolves to white space after preprocessing.
- 代名符
- Hibernate知识复习01
- 日期格式转换2011-01-01=>2011 1 1
- Linux下apache目录明细
- Java高级视频-网络通信[学习中…………]
- 使用Word仅编辑一份文档,同时发布不同版本的技巧
- 代名符
- java throw与throws的区别
- asp.net datagrid实现显示字数限制
- 限制JTextArea显示行数
- Android系统SVC命令教程
- Android应用开发笔记(1):调用打电话和发短信、收短信接口、发Email (Call, Dial, SMSManager, Broadcast, Email)
- Test
- 【Android】declare-styleable属性值
- 收藏一下