הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
more than one default
Remarks
A switch statement contains multiple default labels. Delete one of the default labels to resolve the error.
Example
The following example generates C2048:
// C2048.cpp
int main() {
int a = 1;
switch (a) {
case 1:
a = 0;
default:
a = 2;
default: // C2048
a = 3;
}
}
Possible resolution:
// C2048b.cpp
int main() {
int a = 1;
switch (a) {
case 1:
a = 0;
default:
a = 2;
}
}