brandon_scott (brandon_scott) wrote,
brandon_scott
brandon_scott

Question about FOR loop

In a for loop, when is the counter incremented?

Ex:
for(int iCounter=0; iCounter<someNum; iCounter++)
{
    sum = iCounter + anotherNum;
}


Is iCounter incremented before or after the code block (being added to anotherNum)?
Subscribe

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments