Chinaunix首页 | 论坛 | 博客
  • 博客访问: 70136
  • 博文数量: 1
  • 博客积分: 1465
  • 博客等级: 上尉
  • 技术积分: 155
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-18 13:55
文章分类
文章存档

2008年(1)

我的朋友

分类: C/C++

2008-04-10 22:16:47

If the value of the right operand is negative or is
greater than or equal to the width of the promoted left operand, the behavior is undefined.


main()
{
     int bits = 32;
     printf("%d\n",(int)1 << (int)32);//0

     printf("%d\n",(int)1 << bits);//1
}

阅读(1226) | 评论(1) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~

chinaunix网友2008-05-15 23:19:34

来踩踩,原来每个人都有blog