Cpp Token Pasting Operator

I was struggling to put multiple tokens together in a macro and paste them as a single token in the result. That’s when I stumbled on this link, it said, in very plain english:

The token pasting (##) operator simply eliminates any white space around it and concatenates (joins together) the non-whitespace characters together.

In the very beginning it mentions that this is the least understood operator. Right it was. Just by looking at the above definition, I got my job done. đŸ™‚


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s