Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Best way to break?

Name: Anonymous 2009-02-01 12:26

my current hierarchy looks like this:

main()
{
for()
{
function();
}
}

function()
{
if
{
break;
}
}

apparently c++ doesn't like it if I have the function try and break the for loop, but i need that function to do so. What would be the proper course of action for this scenario?

Name: Anonymous 2009-02-01 12:39

The issue is that i have nested for loops, and when one loop gets to its max value, i need it to reset to its min value and break into the next loop so the next loop can iterate. That means I would need goto statements for each loop, and at that point, i might as well nix the function all together.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List