unsigned char 数据<<8变成unsinged int 数据,这样操作可以。
unsinged char count_a,count_b;
unsinged int count;
Count = count_a<<8|count_b;
但是如果是unsigned int 数据<<16位变成long 数据,这样操作不可以。
Long count ;
unsinged int count_a,count_b;
count = count_a<< 16|count_b;
必须改成下面的才行
Long count ;
unsinged int count_a,count_b;
count = count_a;
count = count << 16|count_b;
谁知道原因,解释下。谢谢
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
struct{
uint16 a;
uint16 b;
}s;
uint32 dat;
}num;
num.s.a=count_a;
num.s.b=count_b;
count = num.dat;
这样呢?
一周热门 更多>