Programmatic way to get variable name in C?
You could try something like this: #define DUMP(varname) fprintf(stderr, “%s = %x”, #varname, varname); I used to use this header I wrote, when I was new to C, it might contain some useful ideas. For example this would allow you to print a C value and provide the format specifier in one (as well as … Read more