for ([init]; [test]; [inc]) statementand performs the following steps:
The initializing expression init normally initializes one or more loop counters. It may also define a new variable as a loop counter. The scope of such a variable is valid until the end of the active block.
Příklad
string s = "Trust no one!"; int sum = 0; for (int i = 0; s[i]; ++i) sum += s[i]; // sums up the characters in s
OBSAH | Translation © 2001 ELCAD v.o.s., Copyright © 2001 CadSoft Computer GmbH |