Hi guys. Just wondering if there is any way of getting loops like 'if' and 'while' to repeat themselves when they are contained within a 'for' loop. I have found they tend to only loop for the first run through of the 'for' and not any of the repeats. Any help would be much appreciated.
Without seeing code it is hard to say for certain but it sounds like you are not resetting the guards on the embedded while loops. Could that be your problem?
1 2 3 4 5 6 7 8 9 10 11
int x =0;
for(int i =0;i <10; ++i)
{
// If x is not rest here the while loop will only run once.
while(x < 10)
{
std:cout << "+";
++x;
}
std::cout <<std:endl;
}