[Tutor] New to this list ....

Russel Winder russel at winder.org.uk
Fri Mar 30 18:36:27 CEST 2012


Ramit,

On Fri, 2012-03-30 at 16:22 +0000, Prasad, Ramit wrote:
[...]
> C switch is just a different way of doing an if/elif tree, I do not 
> really see any real difference. Although, if there is you can feel free 
> to enlighten me. :)
[...]

'fraid not -- though it depends on which compiler and how many cases.
For 3 or more cases compilers will generate a hardware supported jump
table: a switch statement is a jump table not a cascade of if
statements.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/tutor/attachments/20120330/585c35b5/attachment-0001.pgp>


More information about the Tutor mailing list