Charizing operator (Microsoft specific)!

You’ve heard of stringizing pre-processor operators, ever heard of charizing operators?

Very similar to stringizing operators, except that it puts single quotes around it’s arguments, that’s why it’s called the charizing operator!

For stringizing we use “#” operator but for charizing we use “#@”.

Here is an e.g.

From MSDN:

[sourcecode language=’cpp’]#define MakeChar( ch ) #@ch[/sourcecode]

Calling this macro now!

[sourcecode language=’cpp’]const char ch = MakeChar( x );
printf( “After charizing: %c”, ch );[/sourcecode]

After charizing: x

MakeChar expands to ‘x’ which is of char type, hence the name charizing!

Appreciate your comments...