M
Memana
Dear Friends,
In for loop, we can define variables within the 'for' loop's
expression. Like this we can do within 'while', 'if' and 'switch'
statements, this kind of definistion is much less common than those in
'for' expressions, possibly becuase of the syntax is so constrained.
That is, there is a constraint in the syntax of the expressions of
"while", "switch" and "if" statements.
For example we cannot use parentheses as follows:
while((char c == cin.get()) != 'q')
But still I am not understanding, why parenthesis is not possible?
Does that mean that we cannot use parenthesis while defining variables
in the expressions of "while", "switch" or if" statements. ?
If any of you know, please explain...
Meman A
In for loop, we can define variables within the 'for' loop's
expression. Like this we can do within 'while', 'if' and 'switch'
statements, this kind of definistion is much less common than those in
'for' expressions, possibly becuase of the syntax is so constrained.
That is, there is a constraint in the syntax of the expressions of
"while", "switch" and "if" statements.
For example we cannot use parentheses as follows:
while((char c == cin.get()) != 'q')
But still I am not understanding, why parenthesis is not possible?
Does that mean that we cannot use parenthesis while defining variables
in the expressions of "while", "switch" or if" statements. ?
If any of you know, please explain...
Meman A