Every else statement has to follow an if statement. The whole purpose of an 'else' is to be executed if the previous 'if' was not executed. So if there is no previous 'if', then having an 'else' makes no sense.
A dangling else is one that has no previous if.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
if(foo < 5)
{
// this block executed if foo is less than 5
}
else // <- OK, immediately follows an 'if' block
{
// this block executed if foo is NOT less than 5
}
else // <- dangling 'else'. This will be a compiler error because there is no previous 'if'
{
}