连等的if语句_小心编译器
来源:互联网 发布:佣金搜索采集软件 编辑:程序博客网 时间:2024/05/16 18:59
UINT nR = GetRValue (clrDest);
UINT nG = GetGValue (clrDest);
UINT nB =GetBValue (clrDest);
// if(nR == nG == nB == 0)
if((nR == 0)&&(nG==0)&&(nB == 0)) 这两条if语句竟然不是等价的。。
这是在vs2005编译器下测试得到的情况,不知道其他的编译器是不是这样工作的。以后写代码一定要小心啊!
vs2005 测试代码:
// testIf.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
UINT nR = 25;
UINT nG = 25;
UINT nB = 23;
// if(nR == nG == nB == 0)
if((nR == 0)&&(nG==0)&&(nB == 0))
{
printf("dddd");
}
else
{
printf("why_why");
}
return 0;
}
- 连等的if语句_小心编译器
- LCC编译器的源程序分析(29)if条件语句
- [转载]LCC编译器的源程序分析(29)if条件语句
- 小心C++编译器的陷阱
- java开发编译器:C语言逻辑控制语句if else if 的语法解析
- 11_嵌套if语句
- sourceinsight宏的编写-----if等语句的简练
- sourceinsight宏的编写-----if等语句的简练
- mysql语句中用if的例子_数据库技巧
- VS2008 if else等语句块的收缩
- 循环语句和if语句等
- 小心编译器的隐式声明
- <!--[if IE 6]><![endif]-->等语句含义
- oracle控制语句if else,loop等
- ASP的IF语句
- if 语句的优化
- tc的if语句
- if语句的用法
- Activity设置全屏以及Android获得屏幕的宽和高
- 乱七八糟的几个记录:这些软件是干什么的。
- 如何让Android横竖屏切换时不销毁当前activity
- linux下配置JRE和Tomcat环境变量
- 一个Flex鼠标拖拽图片的简单例子(附源码)
- 连等的if语句_小心编译器
- 网上开店步骤
- hadoop-0.20.2-examples.jar grep 示例
- Redhat上安装apache-tomcat
- jquery 实现多级下拉菜单
- Maximum execution time of 30 seconds exceeded
- android Fragments详解
- android am start 启动某个apk
- 解除Discuz!X2的15分钟锁定