0
Colon within the condition in a 'for' loop
int x[10] = {1,2,3,4,5,6,7,8,9,10}; for (int y : x){ // What does the colon do? switch (y) { case 1: cout << "A"; case 3: cout << "B"; case 7: cout << "C"; case 8: cout << "D"; } }
3 Answers
0
AteFish, did you mean 'assign the elements of the array to y' instead?