cpp/language/while

Executes a repeatedly, until the value of  becomes. The test takes place before each iteration.

Explanation
Whether is a compound statement or not, it always introduces a. Variables declared in it are only visible in the loop body, in other words,

is the same as

If is a declaration such as, the declared variable is only in scope in the body of the loop, and is destroyed and recreated on every iteration, in other words, such while loop is equivalent to

If the execution of the loop needs to be terminated at some point, can be used as terminating statement.

If the execution of the loop needs to be continued at the end of the loop body, can be used as shortcut.