B
Bern
i think i wasn't clear enough or you misunderstood.
continue the "big" loop means reset to the beginning of the "big" loop,
which means the condition of the big loop is evaluated , -- as if
the program has just entered the loop.
for example:
while (some condition){
if (condition) continue; //// continue means reset to the beginning
of the loop.
if (another ...){
some code;
}
}
if there is such thing as labeled continue,
we can do the following:
----------------------------------------------------
big_loop:
while (...){
some code;
while (...){
/*
continue big_loop means reset to the beginning
of big loop.
it means exactly "goto big_loop" here.
*/
if (....) continue big_loop;
}
}
however, C/C++ does not support labeled continue and breaks.
i know labeled continue and breaks can be replaced by "gotos",
but, such useful feature why doesn't C++ support?
i think labeled continue and breaks are similar to goto, thats why
the creators of C++ doesn't want to include this feature, since they
are already discouraging the use of goto.
then it comes to this question: Can we really do without gotos??
continue the "big" loop means reset to the beginning of the "big" loop,
which means the condition of the big loop is evaluated , -- as if
the program has just entered the loop.
for example:
while (some condition){
if (condition) continue; //// continue means reset to the beginning
of the loop.
if (another ...){
some code;
}
}
if there is such thing as labeled continue,
we can do the following:
----------------------------------------------------
big_loop:
while (...){
some code;
while (...){
/*
continue big_loop means reset to the beginning
of big loop.
it means exactly "goto big_loop" here.
*/
if (....) continue big_loop;
}
}
however, C/C++ does not support labeled continue and breaks.
i know labeled continue and breaks can be replaced by "gotos",
but, such useful feature why doesn't C++ support?
i think labeled continue and breaks are similar to goto, thats why
the creators of C++ doesn't want to include this feature, since they
are already discouraging the use of goto.
then it comes to this question: Can we really do without gotos??