Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
8.14 and "involved in a decision to exit the loop"
#1
Section 8.14 defines a loop counter as "an object, array element or member of a structure or union which"
  • 1. has scalar type,
    2. varies monotonically on each iteration of a given instance of a loop, and
    3. is involved in a decision to exit the loop.
My question is, "To what extent does the item in question need to be "involved in a decision to exit the loop"? For example, consider the code:
Code:
...
if( g(x) )
    break;
...
Is 'x' "involved in a decision to exit the loop"?

What of
Code:
...
if( h() )
    break;
...
where 'h()' returns a value based on, say, a static variable, 'q'; is 'q' "involved in a decision to exit the loop"?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)