Using a character name as a string literal in a #define function macro
I want the debug function macro to work like this:
int myVar = 5; PRINTVAR(myVar); // macro // which expands to something like... print("myVar: "); println(myVar);
Basically, I want to use the identifier as a string literal as well as a variable.
I'm just a little tired of repeating myself when I want to dump a lot of variables to stdout.
My silly attempt, which of course doesn't work:
Is it possible?
source to share