!!!Constant Expression (From MSDN)
来源:互联网 发布:淘宝钓鱼竿专卖 编辑:程序博客网 时间:2024/05/22 10:38
C++ requires constant expressions — expressions that evaluate to a constant — for declarations of:
Array bounds
Selectors in case statements
Bit-field length specification
Enumeration initializers
The only operands that are legal in constant expressions are:
Literals
Enumeration constants
Values declared as const that are initialized with constant expressions
sizeof expressions
Nonintegral constants must be converted (either explicitly or implicitly) to integral types to be legal in a constant expression. Therefore, the following code is legal:
const double Size = 11.0;char chArray[(int)Size];
From: http://msdn.microsoft.com/en-us/library/3ffb821x.aspx
So we don't need to have constant expression when initialize a const variable:
int i = -1;const int ic = i; //legal.
- !!!Constant Expression (From MSDN)
- Constant expression required
- Regular Expression form MSDN
- switch case constant expression required
- constant expression required 的问题
- 创建线程(From MSDN)
- hashtable example from MSDN
- dynamic_cast Operator from MSDN
- String.Format from MSDN
- enum zz from msdn
- 编译问题 case expression not constant
- cannot appear in a constant-expression
- error C2051: case expression not constant ?
- 编译问题 case expression not constant
- Derived from SQL Expression
- 编制新的 MSDN 目录(From MSDN)
- 编制新的 MSDN 目录(From MSDN)
- 编制新的 MSDN 目录(From MSDN)
- JavaScript -- Frame and window
- android 系统架构
- Writing device drivers in Linux: A brief tutorial(四)
- RPM guide
- JavaScript -- event handler
- !!!Constant Expression (From MSDN)
- symbian 内存检测
- ABAP行转化为列(转)
- linux为gpio构建的使用方法
- 如何序列化Control等复杂类型对象
- 寻找连通域
- Visual C++ 6.0 插件系列介绍
- apache:the requested operation has failed
- Oracle查询动、静态参数