Code A:
if ()
...
else {
if (cond == 1)
/* do something */
}
Code B:
if ()
...
else if (cond == 1)
/* do something */
If there exists differences between code A and Code B?
There only is a potential difference, which becomes visible with slightly extended example code
(please excuse the intentionally misleading indentation, it is exactly the problem you need to keep in mind in this kind of situation):
if ()
...
else {
if (cond == 1)
do_something(); /* executed on !1st and 2nd condition */
do_somthing_else(); /* executed on !1st but unaffecated by 2nd condition */
}
if ()
...
else if (cond == 1)
do_something(); /* executed on !1st and 2nd condition */
do_something_else(); /* ALWAYS executed */