Re: performance in switch
Quote:
Originally posted by asivakumar
so if i change the order as below ,will it increase the performance ??
That depends completely on the compiler implementation. The standard says nothing about how a switch statement will be compiled. One compiler might always generate a sequence of tests and branches, while most compilers will optimize a switch statement by using the case values for calculated jumps if possible - or a combination of both. So it is really compiler dependent, and you shouldn't rely on it.