G
Gunnar G
Is there a problem with the declaration of the y-variable in the for loop?
I'm not sure about the break, (if it should be there or not since I didn't
write the original code), but the error: "initialization of y is skipped by
case label" was reported.
int main(){
int x[10];
int a=4;
switch (a){
case 1: for (int y=0;y<10;y++) x[y]=y; break;
case 2: a=5;
}
}
Thanks,
Gunnar.
I'm not sure about the break, (if it should be there or not since I didn't
write the original code), but the error: "initialization of y is skipped by
case label" was reported.
int main(){
int x[10];
int a=4;
switch (a){
case 1: for (int y=0;y<10;y++) x[y]=y; break;
case 2: a=5;
}
}
Thanks,
Gunnar.