while Loop

From NWN Lexicon
(Redirected from While)
Jump to navigationJump to search

The while loop tests an expression and executes statements repeatedly as long as the expression is TRUE. If the expression evaluates to FALSE at the beginning of the while loop's execution then the statements are skipped over entirely.

// prototype
// while (expression) { statement; }


int i;
while (i < 5)
    // statements ...

 author: Ryan Hunt, editors: Charles Feduke, Mistress, contributor: Ken Cotterill