need help in C

Status
Not open for further replies.

frogonfloor

Broken In
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:

Pathik

Google Bot
Nope.. U can use it without any conditions but like this
for(;;)
{}
it ll be an infinite loop
 

QwertyManiac

Commander in Chief
I guess doing a near-proper disassembly of the code should give you enough obfuscation?

Or... I might just be repeating a heard bluff here.
 

FilledVoid

Who stole my Alpaca!
Code:
for(;;)
{

}

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.
 
Status
Not open for further replies.
Top