I have started to study C++ after having worked with a procedural language for many years. I have read a couple of C++ books (hmm, well at least looked into) and some tutorials about C++. I started to prepare a C++ quick reference guide for my own usage and it was then that I discovered that only Bjarne Stroustrup followed the ANSI standard in "The C++ Programming Language" 3rd edition when the syntax for while and the do...while statements was described.
The formal syntax for these statements are according to this book and the ANSI specification:
the while statement
while ( condition ) statement
the do while statement
do statement while (expression) ;
All other authors I have seen use a different syntax for condition and expression.
That is, condition may be used in both while and do...while
statements or expression may be used in both while and do...while statements.
My question is what the difference is between condition and expression in these statements? I haven't been able to figure it out from the C++ specification :)