What is the best way to check if variable is bigger than some number using switch statement? Or you reccomend to use if-else? I found such an example:
int i; i
I would strongly recommend a if(var1>var2){}else if (var1==var2) {} else {} construct. Using a switch here will hide the intent. And what if a break is removed by error?
if(var1>var2){}else if (var1==var2) {} else {}
break
Switch is useful and clear for enumerated values, not for comparisons.