what's the difference/purpose of using a tree of else if(s) against a series of if(s)?
what's the difference/purpose of using a tree of else if(s) against a series of if(s)?
Speed. A series of ifs will all be checked, but if, for example the first if condition is met, the rest in the if-else block will not be tested. This only works if the conditions are mutually exclusive, but if several can be met at once, you'd need to use a series of ifs, or a series of ef-else blocks.
SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
I say what I say, I mean what I mean.
IDE: emacs + make + gcc and proud of it.