I\'m currently trying to figure out a way to break out of a for loop from within a function called in that loop. I\'m aware of the possibility to just have the
If you cannot handle return values, can you at least add a Parameter to the function: I can imagine a solution like that:
void main (void)
{
int a = 0;
for (; 1 != a;)
{
foo(x, &a);
}
}
void foo( int x, int * a)
{
if (succeeded)
{
/* set the break condition*/
*a = 1;
}
else
{
*a = 0;
}
}
It's my first post, so, please forgive me, if my formatting is messed up :)