摘要:
/* Return 1 when any odd bit of x equals 1; 0 otherwise. Assume w = 32 */ #include <stdio.h> int any_odd_one(unsigned x) { unsigned mask = 0xAAAAAAAA; 阅读全文
摘要:
//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 阅读全文
摘要:
//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 阅读全文
摘要:
//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 阅读全文