hi,
wird eine for-Schleife immer mindestens einmal ausgeführt, auch dann,
wenn die Abbruchbedingung von Anfang an erfüllt ist?
for(uint8_t j=0; j<0; j++)
{
mache();
}
Wrid mache(); einmal aufgerufen oder nicht?
Gast
#2013144
Nein, sollte es nicht. Aber wie soll denn bitte ein unsigned kleiner als 0 werden?
Nicht. [zitat ISO/IEC 9899:TC2 Committee Draft — May 6, 2005 WG14/N1124] 6.8.5.3 The for statement The statement for ( clause-1 ; expression-2 ; expression-3 ) statement behaves as follows: The expression expression-2 is the controlling expression that is evaluated before each execution of the loop body... [/zitat]
danke
Antwort schreiben
Bitte melde dich an, um einen Beitrag zu schreiben.