if (/* First If condition */)
{
}
if (/*second if condition*/)
{
}
else
{
}
What I am confused about is, this "else" condition, which "if" statement will it be comparing itself to? The first or the second? I would like it to compare itself to the second.
To the second.
In ide press ctrl-t
That will indrnt your code (it is wrong now).
Your indrntation suggests it is a nested if, but the {} say it is not..
A @build_1971 said, the 2nd if is outside the braces of the first - so it stands alone.
Fixing the indentation:
if (/* First If condition */)
{
} // first 'if' ends here
if (/*second if condition*/) // entirely new and unrelated statement
{
}
else // immediately follows the 2nd 'if' - so that's the one it "attaches" to
{
}