If you want the loop to break at a certain point, just place an if with a break.
Code:int test = 1; /*1 is true hence infinite true while loop*/ while ( test ) { test++; if ( test > 10 ) { break; } } printf("Loop broke as test reached 10\n");
If you want the loop to break at a certain point, just place an if with a break.
Code:int test = 1; /*1 is true hence infinite true while loop*/ while ( test ) { test++; if ( test > 10 ) { break; } } printf("Loop broke as test reached 10\n");
Double Helix STL