Using for loop in if (conditional part)

Hello I want to test a two dimensional array's members with if statement and I tried using loops inside the conditional part of the if statement

1
2
3
4
5
6
7
8
9
10
11
12
13
if(
for(i=x1;i=<x2;i++)//loop1
{
	for(j=y1;j=<y2;y++)//loop2
       {
	table[j].tblrow[i]=='0'
       }
}
  )
	{
        /*...........*/
        }
}

bur the result is a compiler error
how can I do it?
1
2
3
4
5
6
7
8
9
10
11
12
int foundZero=0;
for(i=x1;i=<x2;i++)//loop1
{
	for(j=y1;j=<y2;y++)//loop2
       {
	if (table[j].tblrow[i]=='0') {foundZero = 1; break;}
       }
}

if (foundZero)
{ // code here
}
Last edited on
thank you
Topic archived. No new replies allowed.