05 2020 档案

摘要://csapp 2.63, 还原算数右移,逻辑右移 include unsigned srl(unsigned x, int k) { / Perform shift arithmetically / unsigned xsra = (int) x k; //begin this //此处由于转换成 阅读全文
posted @ 2020-05-10 22:40 铵铵静静 阅读(271) 评论(0) 推荐(0) 编辑
摘要://csapp 2.62 include //算数右移返回1,否则返回0 int int_shifts_are_arithmetic() { //return !~( 1 1); unsigned int w = sizeof(int) (w 1)); } int main(void) { prin 阅读全文
posted @ 2020-05-10 19:21 铵铵静静 阅读(150) 评论(0) 推荐(0) 编辑
摘要://csapp2.61 编写表达式,下列条件下产生1,否则0,假设x是int类型,不允许使用 ==,!= include typedef unsigned char byte_printer; //打印二进制数据 void show_bytes (byte_printer start, size_t 阅读全文
posted @ 2020-05-10 19:17 铵铵静静 阅读(225) 评论(0) 推荐(0) 编辑
摘要://csapp 2.60 include include typedef unsigned char char_point; uint32_t replace_byte(uint32_t x, int i, unsigned char b) { if(i 3 || i < 0) { return 1 阅读全文
posted @ 2020-05-08 21:21 铵铵静静 阅读(322) 评论(0) 推荐(0) 编辑
摘要://csapp 2.59 编写c语言表达式,它由X最低有效字节,和y剩余字节组成 include include int main(void) { int32_t x,y,z; x = 0x89ABCDEF; y = 0x76543210; z = 0x765432EF; printf(" z==r 阅读全文
posted @ 2020-05-08 20:09 铵铵静静 阅读(352) 评论(0) 推荐(0) 编辑
摘要://csapp 2.58 include include include typedef unsigned char char_point; / 判断机器类型,大端机返回0, 小端机返回1,其他返回 1 author : date : 2020 5 7 20:54:03 / int is_littl 阅读全文
posted @ 2020-05-07 22:15 铵铵静静 阅读(199) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示