Yes, I meant what you have written there. The thing I was wondering about was if it is proper to leave the else part off the if, so instead of
Code:
if( condition 1 )
{
do something for cond 1;
}
else if( condition 2 )
{
do something for cond 2;
}
else if( condition ...
and so on (as you wrote), you would have,
Code:
if( condition 1 )
{
do something for cond 1;
}
if( condition 2 )
{
do something for cond 2;
}
if( condition...
where the else is omitted.
The only reason I ask is that I have seen this sort of thing in various places online, yet in my C books, I only see what you wrote with 'else if' - I assume that it is proper to write the way you demonstrated, but the other way is somewhat 'legal'?