2013年4月15日

摘要: 测试程序: 1 #include <stdio.h> 2 3 #define RANGE(type) \ 4 if ( (type)((type)0 - 1) > 0 ) \ 5 { \ 6 type m = 0; \ 7 m = m - 1; \ 8 printf("%s:\t %d Bytes [%.0f µ½ %.0f] \n", #type, sizeof(type), (double)0, (double)m ); \ 9 } \10 else \11 { \12 ... 阅读全文
posted @ 2013-04-15 19:06 n_a_n_c 阅读(398) 评论(0) 推荐(0)
 
摘要: 如下代码,在进行强制类型转换时,会导致打印出来的数据不是想要的: 1 #include <stdio.h> 2 3 void AddFunc (unsigned int a, unsigned int b, unsigned int * c) 4 { 5 *c = a + b; 6 } 7 8 int main(void) 9 {10 unsigned char e = 100;11 unsigned char f = 200;12 unsigned char g = 0;13 unsigned int p =0;14 15 AddFunc(... 阅读全文
posted @ 2013-04-15 18:59 n_a_n_c 阅读(332) 评论(0) 推荐(0)