交换半字节的char元素 [英] Swapping the nibbles in a char element
本文介绍了交换半字节的char元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是一个char元素啃?
What are nibbles in a char element?
我们怎么换呢?
谁能解释半字节的交换用一个例子:
Can anyone explain the swapping of the nibbles with an example:
推荐答案
半字节(或半字节,通过类比字节VS BITE)是一个4位块字符
。
The nibbles (or nybbles, by analogy with byte vs bite) are 4-bit chunks of a char
.
您可以用交换它们:
c = ((c & 0x0F) << 4) | ((c & 0xF0) >> 4);
这篇关于交换半字节的char元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文