#define PRINT_INT( n ) printf( #n " = %d\n", n ) #define PRINT_STRING( s ) printf( #s " = %s\n", s ) //使用方法 void test(void) { int a = 0; char str[] = "test string"; a++; PRINT_INT(a); PRINT_STRING(str); }
#define PRINT_INT( n ) printf( #n " = %d\n", n ) #define PRINT_STRING( s ) printf( #s " = %s\n", s ) //使用方法 void test(void) { int a = 0; char str[] = "test string"; a++; PRINT_INT(a); PRINT_STRING(str); }
转载于:https://www.cnblogs.com/lynd/archive/2012/10/24/2737948.html