I'd like to do something like this:
class SomeClass { }; GENERATE_FUNTION(SomeClass)
The GENERATE_FUNCTION
macro I'd like to define a function whose name is to be determined by the macro argument. In this case, I'd like it to define a function func_SomeClass
. How can that be done?
#define GENERATE_FUNCTION(Argument) void func_##Argument(){ ... }
More information here: http://en.wikipedia.org/wiki/C_preprocessor#Token_concatenation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With