somebody help me! can you find the error in this c_code?

2025-12-17 00:39:47
推荐回答(2个)
回答1:

#include 
#define PRINT_INT(i)   \
printf("%8s(): &%-5s= 0x%-6x ,%-5s= 0x%-6x \n",__FUNCTION__, #i,&(i),#i,i);
void main(void)
{

 int a,b;
 scanf("%x%x",&a,&b);       // hex
 PRINT_INT(a);
 PRINT_INT(b);

}

scanf输入的时候,b要对它取地址,用&而不是%

回答2:

scanf("%x%x",&a,%b); &b