#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
typedef unsigned char* byte_pointer;
/*表示: 高位->低位(和机器采用大端法和小端法有关) 本例机器采用小端法表示数据*/
void show_bytes(byte_pointer word,size_t len) {
printf("0x");
for (int i = len - 1; i >= 0; --i) {
printf("%.2x",word[i]);
}
printf("\n");
}
void show_bits(byte_pointer word,size_t len) {
for (int i = len - 1; i >= 0; --i) {
unsigned int byte = word[i];
unsigned int mask = 128;
for (
C语言 数据的位级表示及操作
最新推荐文章于 2022-07-31 14:21:38 发布
本文深入探讨C语言中数据的位级表示,并重点讲解了位移操作,包括左移运算符和右移运算符的使用,阐述它们在二进制操作中的应用和注意事项。

最低0.47元/天 解锁文章
1045

被折叠的 条评论
为什么被折叠?



