J jinexile In Runtime Messages 260 Aug 8, 2005 #11 I've been using vb for a while, my cpp is kind of rusty.
I Iron_Cross Daemon Poster Messages 549 Location Bamberg, Germany Aug 8, 2005 #12 To make your code run forever, at least until x equals 50 you could do one of the following: Code: do { // insert code here }while( x != 50 ); Code: while( x != 50 ) { // insert code } Code: for( ; x != 50 ; ) { // insert code here } Code: while(1) { // insert code here if( x == 50 ) break; } Code: for(;;) { // insert code if( x == 50 ) break; } Those are just a few ways
To make your code run forever, at least until x equals 50 you could do one of the following: Code: do { // insert code here }while( x != 50 ); Code: while( x != 50 ) { // insert code } Code: for( ; x != 50 ; ) { // insert code here } Code: while(1) { // insert code here if( x == 50 ) break; } Code: for(;;) { // insert code if( x == 50 ) break; } Those are just a few ways
OP OP W waynejkruse10 Fully Optimized Messages 3,782 Aug 8, 2005 #13 thanks guys for all your input. My compiler seems to accept the while (true); { } format.
T TheHeadFL Daemon Poster Messages 530 Aug 8, 2005 #14 Be very careful with while(true) loops. Many compilers will even issue a warning on that kind of code.
Be very careful with while(true) loops. Many compilers will even issue a warning on that kind of code.
OP OP W waynejkruse10 Fully Optimized Messages 3,782 Aug 8, 2005 #15 nup, no warning. What do i need to be worried about?
Calzinger Beer Messages 565 Location New York Aug 8, 2005 #18 Some compilers will crap out. You'll find yourself stuck and have needless trouble with ending the program.
Some compilers will crap out. You'll find yourself stuck and have needless trouble with ending the program.
A aniket Baseband Member Messages 46 Aug 22, 2005 #20 hey any value in C conditions other than 0(zero) is treated as true thats why if u will write if 1 then { } then the code will get exicuted as value 1 is non zero so even if 4+5 then { } will exicute code between { }
hey any value in C conditions other than 0(zero) is treated as true thats why if u will write if 1 then { } then the code will get exicuted as value 1 is non zero so even if 4+5 then { } will exicute code between { }