redundant code: constant expression is zero
#1

Hi everyone

I get this message "warning 205: redundant code: constant expression is zero" with this piece of code when I compile, can be can you give me some help?

thx

Код:
GetNumberOfPages()
{
	if((300 >= 21) && (300 % 21) == 0)
	{
		return (300 / 21);
	}
	else
	{
		return (300 / 21) + 1;
	}
}
Reply
#2

The compiler does constant math. This means that you will just end up with:
pawn Код:
if(false)
{
    return 14;
}
else
{
    return 15;
}
You can't write an if-statement without some kind of variable.
Reply
#3

Ok thx for you help !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)