两个unsigned int 数据合成一个long 数据的问题

2020-01-19 19:33发布

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;

谁知道原因,解释下。谢谢
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。