0
What is the meaning of "int y : x" here, in the for loop?
int main() { int x[5] = {1,2,3,4,5}; for(int y : x) { switch(y) { case 1 : cout<<"C"; case 2 : cout<<"P"; case 3 : cout<<"P"; } } }
1 Antwort
int main() { int x[5] = {1,2,3,4,5}; for(int y : x) { switch(y) { case 1 : cout<<"C"; case 2 : cout<<"P"; case 3 : cout<<"P"; } } }