How can make my code to loop without defining any conditions. Just to loop no matter what?
How can make my code to loop without defining any conditions. Just to loop no matter what?
Well you could simply use *looks around, leans in, whispers* goto
*ducks*
However I would simply place a true constant in the parameters such as
This works for all types of loops. You can use a for loop and simply not increment your parameter as well:Code:#include <stdio.h> void Foo(void); //prototype int main(void) { do{ Foo(); }while(1); return 0; } void Foo(void) { //function definition printf("Hello world\n"); }
What exactly are you trying to accomplish?Code:for(int i = 0; i< 10; )
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
or
Code:for(;;) { ... }
Do not use 'goto'. There are a very few rare occasions when it is acceptable to use, and this is NOT one of them. This is a perfect example of improper 'goto' usage. Go with sand_man or andyhunter's suggestions:
Code:while(1) { } while(true) { } for(;;) { }
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
the for(; works...
*._. grrr...evil smiley i mean ( ; ; )