i would like to write an "if" loop so that when the condition of the if loop is satisfied (so the statements in the if loop runs), the program quits.
i have tried exit(1); but this ends the CERN Root session in addition to ending the program. i know the use of break is not appropriate within an if loop (or so i've been told).
what would be the proper command to end the program?
Hmmmm once return is encountered, the loop ends, along with the function. I don't see the point in placing a return statement there. A simple if statement would suffice. For example:
1 2 3 4 5 6
while( true )
{
if( Number == 0 )
// Break from the loop
break;
}