Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2111
Collapse the table of content
Expand the table of content

Compiler Error C2111

Error Message

'+' : pointer addition requires integral operand

An attempt was made to add a nonintegral value to a pointer using the plus ( + ) operator.

The following sample generates C2111:

// C2111.cpp
int main() {
   int *a = 0, *pa = 0, b = 0;
   double d = 0.00;
   
   a = pa + d;   // C2111
   a = pa + b;   // OK
}

Community Additions

ADD
Show:
© 2015 Microsoft