can (switch) be apart of a loop?
i using a switch statment inside of a loop
for some reason first switch case executes but when the loop starts over seams like the switch statments isn't even touched
here's an example:
const int MaxMonths = 12;
for(int k = 0; k < MaxMonths; ++k) // Iterates 12 times
{
switch (k)
{
case 0: {cout << "Janurary "; break;}
case 1: {cout << "Febrary "; break;}
case 2: {cout << "March "; break;}
case 3: {cout << "April "; break;}
case 4: {cout << "May "; break;}
case 5: {cout << "June "; break;}
case 6: {cout << "July "; break;}
case 7: {cout << "August "; break;}
case 8: {cout << "September "; break;}
case 9: {cout << "Octoter "; break;}
case 10: {cout << "November "; break;}
case 11: {cout << "December "; break;}
}
}
first line prints January and then no other months are printed..
hmmmm...
what do you guys think???