Is there a way to do a #define inside of another #define?

The C++ Standard says (16.3.4.3):

The resulting completely
macro-replaced preprocessing token
sequence [… of the macro expansion…] is not processed as a
preprocessing directive even if it
resembles one…

So no, there is no ‘official’ way of achieving what you want with macros.

Leave a Comment