if elseif vs. switch
i got impression if else if chains seem produce smaller code switch statements. has explanation why case? curious. have expected switch statements produce shorter code. why other way round?
udo
udo
one way optimize switch statements use jump table. the typical sequence perform bit of math on switch expression , perform indirect jump using table.
i have no idea if compiler performs optimization but, if does, might explain difference in code size.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > if elseif vs. switch
arduino
Comments
Post a Comment