problem with for & if combined!!

Hi! I have a problem when I try to do this:

for (i=1,i<n,i++)
for (j=1,j<m,j++)
{
if (j=1)
{
ax[i][j]=70;
}
else
{
if (j=m)
{
ax[i][j]=80;
}
else
{
if (i=1)
{
ax[i][j]= 90;
}
else
{
ax[i][j]= 50;
}
}
}
}

I don´t know why this doesn´t work. I realised that when i=1, j could be = 1 also, but, apparently, with this configuration that problem doesn´t exist.

Any idea?
if (i=1)

= is assignment.
You want ==, which is comparison.
Topic archived. No new replies allowed.