片段
- 1 #include <stdio.h>
-
2
-
3 int main( int argc , char **argv )
-
4 {
-
5 unsigned int w = 32;
-
6 printf("1U << w : 0x%x\n" , 1U << w );
-
7
-
8 return 0;
-
9 }
-
10
在x86上 , 根据编译时是否进行优化 , 运行结果也不同
- 05:21:30-xuk@localhost:~/svn/goodbyeworld/binary-hacks/48$gcc main.c
-
05:21:46-xuk@localhost:~/svn/goodbyeworld/binary-hacks/48$./a.out
-
1U << w : 0x1
-
-
-
05:22:14-xuk@localhost:~/svn/goodbyeworld/binary-hacks/48$gcc -O2 main.c
-
05:22:54-xuk@localhost:~/svn/goodbyeworld/binary-hacks/48$./a.out
-
1U << w : 0x0
阅读(719) | 评论(0) | 转发(0) |