This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange problem with loop

Hi.

Ive been programing for nearly five months now so I am not a noob but I cannot understand this;

for ( variable = 1 ; variable < 100 ; variable += 1 )
{
  // some code

  if ( foofar )
    continue ;
  else
    sumfunc () ;
}

<endpre>

if i continue does the variable get added?


Parents
  • The standard isn't really so scary. You browse to the index at the back of the document, and look for "continue". Then you get sent to a section describing the continue, with code examples for "for", "while" and "do-while".

    The standard is only scary if you decide from the start that it must be scary. But since it is the ultimate reference for a compiler vendor, it is a must for a developer to have handy.

    It may not be a document you read from start to end when bored - or you may have to be bored to do it :) - but it is excellent to supply the answer if you have a doubt about something.

Reply
  • The standard isn't really so scary. You browse to the index at the back of the document, and look for "continue". Then you get sent to a section describing the continue, with code examples for "for", "while" and "do-while".

    The standard is only scary if you decide from the start that it must be scary. But since it is the ultimate reference for a compiler vendor, it is a must for a developer to have handy.

    It may not be a document you read from start to end when bored - or you may have to be bored to do it :) - but it is excellent to supply the answer if you have a doubt about something.

Children
No data