Consider the following code snippet:
int totalLength = 0;
int partLength = 0;
for(; totalLength < SOME_CONST; totalLength += partLength, partLength = 0)
{
}
In this particular case, can I assume that partLength will be set to 0 AFTER it is added to totalLength (so if partLength is increased in the body of the loop, I will not add 0 to totalLength at the end of the loop)? I read about C ++ sequences, etc., but did not find a clear answer.
source
share