when i do this:
Code:
for(s=0; s<full; s++)
{
if((int)abs((ident[s].top/ident[s].bottom) - (tempIDTop/tempIDBottom)) < value);
{
value = (int)abs((ident[s].top/ident[s].bottom) - (tempIDTop/tempIDBottom));
positionID = s;
}
}
It works.
But if i add an else like this it doesnt work:
Code:
for(s=0; s<full; s++)
{
if((int)abs((ident[s].top/ident[s].bottom) - (tempIDTop/tempIDBottom)) < value);
{
value = (int)abs((ident[s].top/ident[s].bottom) - (tempIDTop/tempIDBottom));
positionID = s;
}
else
{
printf("%d\n", (int)abs((ident[s].top/ident[s].bottom) - (tempIDTop/tempIDBottom)));
}
}
I get this error:
Code:
process.c:266: error: ‘else’ without a previous ‘if’
Line 266 is the line starting with else.