Possible mistaken empty statement

  • Thread starter Thread starter Jim McGivney
  • Start date Start date
J

Jim McGivney

Why is this a "possible mistaken empty statement" ?

Color Kolor = MyBMP.GetPixel(j, k);
Color TheColor = Color.FromArgb(255,255,0,128);

if (Kolor == TheColor); // This is the statement
flagged as possible mistaken empty statement
{
Kount++;
}

Thanks in advance for your help.
Jim
 
Why is this a "possible mistaken empty statement" ?

                    Color Kolor = MyBMP.GetPixel(j,k);
                    Color TheColor = Color.FromArgb(255,255,0,128);

                    if (Kolor == TheColor);  //  This is the statement
flagged as possible mistaken empty statement
                    {
                        Kount++;
                    }

Thanks in advance for your help.
Jim

Because you placed a ; after the ) this will mark the end of the if
statement and the {} statements will be interpreted as a scope
declaration not as part of the IF
 
Back
Top