'else' cannot start a statement.
A semicolon (;) will end a statement. Empty statements are valid code.
In this example code the scope created after the if statement is disconnected from the if.
if (example) ;
{
// ...
}This is the same as writing:
if (example)
{
}
{
// ...
}Don't place a semicolon directly after an if statement.
Remove the semicolon (;) after the first if statement.
if (example) ; // <- Remove this semicolon.
{
// ...
}
else
{
// ...
}