need help in C ( using for loop without condition in bracket )
Hi friends i want to ask one question . this is realy crazy question but still i am asking
can we use for loop without giving any condition in bracket
i mean for() nothing in bracket .
Last edited by frogonfloor; 06-03-2008 at 08:59 PM.
Advertisements. Register and be a member of the community to get rid of them.
Yeah they mean the same.... I just use TRUE and FALSE because it is easier to understand than while 1 or 0. Theoretically, you can use any non zero positive integer to indicate TRUE.
Any part of the for statement can be left out . However the semicolons must be used in any case. The above gives you an infinite loop cause there is no condition being tested for , no variable being initialized as a counter in it or incrementing / decrementing the counter in it. Unless you know what you were doing you would not use this syntax in one of your programs.
__________________
The Ultimate Chess Strategy : "Hit Hard, Hit Fast and Hit Often"