Compiler Error C2111
'+' : 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
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for