> hi,
> what is the difference between:
> return;
> break; and
> continue;
> ?
In the context of from within a loop, return returns control to the calling code, break gives control to the line following the loop, and continue gives control to the line that starts the loop (skipping the rest of the code in the current iteration).
Hope that helped
Lee
It should also be noted (if it hasnt) that you can LABEL loops
and break out of specific loops by name.
http://www.devx.com/tips/Tip/31853
X:
for (int i = 0; i < x; i++) {
...
Y:
for (int j = 0; j < y; j++) {
...
Z:
for (int k = 0; k < z; k++) {
...
if (some_condition) {
break Y;
}
}
}
...
*
}