Pastaba.
Prieigai prie šio puslapio reikalingas įgaliojimas. Galite bandyti prisijungti arba pakeisti katalogus.
Prieigai prie šio puslapio reikalingas įgaliojimas. Galite bandyti pakeisti katalogus.
switch expression not integral
Remarks
The switch expression evaluates to a noninteger value. To resolve the error, use only integral values in switch statements.
Example
The following example generates C2050:
// C2050.cpp
int main() {
int a = 1;
switch ("a") { // C2050
case 1:
a = 0;
default:
a = 2;
}
}
Possible resolution:
// C2050b.cpp
int main() {
int a = 1;
switch (a) {
case 1:
a = 0;
default:
a = 2;
}
}