M
MBALOVER
Hi all,
I want to quit of both "for" loop whenever I find x[j]=1;
Do you know how to do it?
Right now, I am using the following code but I believe there should be
a much more efficient way for this task.
flag=0;
for (i=0;i<H;i++)
{
for (j=0;j<H;j++)
if (x[j]==1)
{
flag=1;
break;
}
if( flag)
break
}
Thanks
I want to quit of both "for" loop whenever I find x[j]=1;
Do you know how to do it?
Right now, I am using the following code but I believe there should be
a much more efficient way for this task.
flag=0;
for (i=0;i<H;i++)
{
for (j=0;j<H;j++)
if (x[j]==1)
{
flag=1;
break;
}
if( flag)
break
}
Thanks