今天在《Windows程序设计》里看到这么一句话:#define __TEXT(quote) L##quote

不理解“##”干什么的,记得以前好像见过,但是记不清了。上网查了一下,一网友推荐的链接

http://msdn.microsoft.com/en-us/library/09dwwt6y(vs.71).aspx

恩,记下来。

Token-Pasting Operator (##)

Visual Studio .NET 2003
Other Versions

The double-number-sign or "token-pasting" operator (##), which is sometimes called the "merging" operator, is used in both object-like and function-like macros. It permits separate tokens to be joined into a single token and therefore cannot be the first or last token in the macro definition.

If a formal parameter in a macro definition is preceded or followed by the token-pasting operator, the formal parameter is immediately replaced by the unexpanded actual argument. Macro expansion is not performed on the argument prior to replacement.

Then, each occurrence of the token-pasting operator in token-string is removed, and the tokens preceding and following it are concatenated. The resulting token must be a valid token. If it is, the token is scanned for possible replacement if it represents a macro name. The identifier represents the name by which the concatenated tokens will be known in the program before replacement. Each token represents a token defined elsewhere, either within the program or on the compiler command line. White space preceding or following the operator is optional.

This example illustrates use of both the stringizing and token-pasting operators in specifying program output:

#define paster( n ) printf( "token" #n " = %d", token##n )
int token9 = 9;

If a macro is called with a numeric argument like

paster( 9 );

the macro yields

printf( "token" "9" " = %d", token9 );

which becomes

printf( "token9 = %d", token9 );

Windows编程,关于##的意思相关推荐

  1. 如何使对话框中接收到WM_CHAR消息(Windows编程)

    我们大家都知道,对话框是有的时候捕获不到WM_CHAR消息的.比如,你想使对话框里的Edit控件所键入的全部变为大写.我们毫不犹豫的写到:    #include //Declare the Dial ...

  2. 使用c++进行Windows编程中各种操作文件的方法 【转】

    https://www.zhaokeli.com/article/8232.html 使用c++进行Windows编程中各种操作文件的方法 [转] 来源:赵克立博客 分类: C/C++ 标签:--发布 ...

  3. 【Windows编程】系列第三篇:文本字符输出

    2019独角兽企业重金招聘Python工程师标准>>> 上一篇我们展示了如何使用Windows SDK创建基本控件,本篇来讨论如何输出文本字符. 在使用Win32编程时,我们常常要输 ...

  4. Windows编程一日一练(1)

    首先,编程和旅游是我个人人生两大爱好,所以,每天空闲的时候我喜欢敲敲代码,或者看看别人写的程序,实在是很惬意.今天想看看window编程,争取坚持每日一练.        windows程序主要是由微 ...

  5. Windows 编程

    Delphi 利用Object Pascal 和可视控件库(VCL)对底层的Windows API 进行了完美的封装,所以很少需要使用基础Pascal 语言来建立Windows应用程序,也无需直接调用 ...

  6. 一个物理学家学习Windows编程的感受

    最近学习用Visual C++ 作为平台的Windows 编程,感觉到学习这种编程技术的过程与学习物理的思维差异非常大.最明显的,比如对于物理课本,在学习的时候值得一个字一个词的认真去读,有时候需要读 ...

  7. C++,C++编程,Windows编程,MFC

    编程 我们日常生活中接触到的电子类产品中的应用都是由编程而来 为什么编程,偷懒 我们通过编程驱使(指挥,命令)的是电信号 为什么上面说编程是偷懒,电的发现,给人们带来了便利,人们在各个方面驱使(换成& ...

  8. Windows编程初步(一)

    第一节:安装帮助文档 使用C语言进行Windows开发,必然使用到WindowsSDK.Windows SDK指Windows开发人员工具包,是为使用C语言开发Windows程序所提供的工具集.里面提 ...

  9. 学好Windows编程要看的书籍

    本文是接着前面的学好C++要阅读的书籍而写的,如果想了解C++的学习的话请先看学好C++要阅读的书籍:http://blog.csdn.net/a809146548/article/details/4 ...

  10. C/C++:Windows编程—Hook IE浏览器实现URL拦截及更改(下)

    Hook IE浏览器实现URL拦截及更改(下) 前言 接上一篇 C/C++:Windows编程-Hook IE浏览器实现URL拦截及更改(上),本节为了实现上一篇待优化部分.实现IE进程时时监控,当有 ...

最新文章

  1. ios中常用数据类型相互转换
  2. 考试系统—— 刷新页面 考试剩余时间不重新开始
  3. 流计算程序不报错,但是没有输出的一些原因(持续更新中)
  4. html class和id,css教程之样式表的基本语法(二) class(类)和id的一个小实例
  5. 谁说 JavaScript 简单的?
  6. 大数据错题库(微信群Bug整理)
  7. 【触动精灵将图片转成base64字符串后通过post方式上传给服务器】
  8. 万能视频格式转换器 v 2018 全能版
  9. python基于scrapy框架爬取当当图书信息
  10. XDD QQ机器人修复方案
  11. nacos开机启动报错找不到JAVA_HOME
  12. “心脏滴血”漏洞复现
  13. 电商用户价值分析(应用RFM模型)
  14. Cousera-Introduction to Data Science in Python Assignment1-4答案
  15. 右侧追击(二)——券商行业
  16. 示波器怎么当做记录仪用​
  17. iOS APP 开发流程
  18. 根据时间、所在地计算给定深空天体的方位角和高度;制定深空天体观测计划
  19. zero eclipse_全球首款真无孔机!魅族zero亮相:支持屏幕发声和18W无线快充
  20. 计算机专业的选择和分类

热门文章

  1. 嵌入式软件工程师面试题(七)
  2. 【其他】小红伞Avira,扫描压缩文件
  3. 图书馆管理系统--stage2核心代码实现
  4. 关于 PC微信SDK二次开发
  5. 计算机屏幕荧光是什么意思,荧光屏的意思是什么
  6. WJMZBMR打osu! / Easy【期望dp】
  7. 甲骨文大裁员后,中国企业软件业务能做什么?
  8. 用AidLux跑老人摔倒检测项目,看AI助老轻松落地
  9. FPGA 视频拼接器的输入卡
  10. Flarum 源码安装错误