Saturday, December 5, 2009

Can someone please explain to me how this loop condition works?

int count = 5;


while (--count)


cout %26lt;%26lt; “Hello” %26lt;%26lt; endl;Can someone please explain to me how this loop condition works?
Hm....





























Print ';Hello'; until 'count' reach zorro!


count = -1 equal count = 0xfffeCan someone please explain to me how this loop condition works?
Sets the variable ';count'; to 5.


Decreases the ';count'; variable value by one unit, and checks for if it's 0. If it's 0, exits the loop, else it executes the line below (cout...).

No comments:

Post a Comment

 
virus protection