#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);
}

 

posted on 2012-10-24 23:14  林德伟  阅读(203)  评论(0编辑  收藏  举报