S
Stefan Ram
I have devised two tests for learners of C++:
1.) When you want to test whether something is an
expression within a correct program, put a pair of
parentheses around it. If it is an expression, the
program will still be correct and the behavior of the
program will not change.
2.) When you want to test whether something is a statement
within a correct program, put a pair of braces around it.
If it is a statement, the program will still be correct
and the behavior of the program will not change.
To make sure that the rules are correct, I would like to know
whether anyone can find a counterexample. (I am aware of such
a counterexample in Java, but not in C++.)
1.) When you want to test whether something is an
expression within a correct program, put a pair of
parentheses around it. If it is an expression, the
program will still be correct and the behavior of the
program will not change.
2.) When you want to test whether something is a statement
within a correct program, put a pair of braces around it.
If it is a statement, the program will still be correct
and the behavior of the program will not change.
To make sure that the rules are correct, I would like to know
whether anyone can find a counterexample. (I am aware of such
a counterexample in Java, but not in C++.)