很简单的函数的参数中传指针的问题
void parse(int index,int *first,int *last)
{
first = index >> 8;
last = index & 0xff;
return ;
}
void main()
{
int first,last,index;
index = 0x888888;
parse(index,&first,&last);
printf("index = %x --> %x << 8 + %x \n",index,first,last);
}
总是解析的不对,大家来看看为什么呢?