Export (0) Print
Expand All
Expand Minimize

Compiler Error C2166

l-value specifies const object

Code attempts to modify an item declared const.

The following sample generates C2166:

// C2166.cpp
int f();
int main() {
   ( (const int&) 1 ) = 5;   // C2166
}

Community Additions

ADD
Show:
© 2015 Microsoft