i want to define a macro where i can print a variable's name and value
#define DBG(x) printf("DEBUG >> "#x" == %d\n",(x))
Example:
#include <stdio.h> #define DBG(x) printf("DEBUG >> "#x" == %d\n",(x)) int main() { int u4_heap_mem_size = 8890; DBG(u4_heap_mem_size+1); // prints DEBUG >> u4_heap_mem_size+1 + == 8891 return 0; }
In reply to Re: [OT] Macro Problem
by Anonyrnous Monk
in thread [OT] Macro Problem
by vishnu.prasad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |