I have to combine C code with some inline assembly.
I allready have simple mechanism converting my enum values and macros into strings:
#define STR(x) #x
#define DEF2STR(x) STR(x)
"string1 " DEF2STR(MACRO_VALUE_2) " string2"
output string after preprocessing is: "string1 2 string2"
Question is, how can I append sizeof(type) value into string? Thanks.
You can't - sizeof(type)
will be evaluated after macro substitutions have taken place... later in the compilation phases.
Why are you trying to do that? Maybe there's another way to get what you really want done....
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