Macro Stringize Operator (#)

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> Jiehui on ‎02-06-2017 12:17 AM

The '#' may be used within a macro (#define) definition, this will convert the macro parameter into a string constant that is stored in Code space. Note that this operator may be used only in a macro that has a specified argument or parameter list.

 

Here is an example for Keil C51. User should get similar result on ARM Cortex M devices with GNU ARM toolchain.

 

C51_MacroOp#.png