Home > Enterprise >  C possible to create macros with non-alpha names?
C possible to create macros with non-alpha names?

Time:04-13

Is it possible to make preporcessor to replace an arbitrary string with an arbitrary string?

I would like to replace { } with {:.{}}

CodePudding user response:

C possible to create macros with non-alpha names?

I would like to replace { } with {:.{}}

No, you cannot achieve this using the standard pre-processor. Macro names are identifiers. Identifiers may contain digits (except first char), latin alphabet, underscore, and characters in XID_Start/XID_Continue classes.


P.S. Consider avoiding pre-processor macros when possible.

  • Related