A switch statement , Computer Engineering

Which is more efficient, a switch statement or an if else chain?

Ans) The differences, if any, are likely to be small. The switch statement was designed to be efficiently implementable, though the compiler may want to use the equal of an if/else chain (as opposed to a compact jump table) if the case labels are sparsely distributed.

 

 

Posted Date: 4/8/2013 3:12:34 AM | Location : United States







Related Discussions:- A switch statement , Assignment Help, Ask Question on A switch statement , Get Answer, Expert's Help, A switch statement Discussions

Write discussion on A switch statement
Your posts are moderated
Related Questions
Define addressing modes. The dissimilar ways in which the location of an operand is specified in an instruction are referred to as addressing modes.

Define congestion and grade of service. Congestion : This is uneconomic to give sufficient equipment to carry all the traffic which could possibly be offered to a telec

Shell is the exclusive feature of? Ans. Shell is the exclusive feature of UNIX.

Which Command permits for vertical alignment of fields one below the other. UNDER Command is used ofr vertical alignment.

Problem 1 Prove that :- x(x + y) = x by using identities 2 Write a short note on Analog to Digital Converter (ADC) 3 Differentiate between sequential and combinational ci

A number of 256 x 8 bit memory chips are available. To design a memory organization  of 2 K x 8 memory. Identify the requirements of 256 x 8 memory chips and explain the details.

explain in detail about queueing process

Q. How can we Resize Layout Cells? To precisely design a page, you can set size of cells you add in a document. You can reposition cells in the page as well. 1.      Click o

There are basically two methods of copying: Photocopying This is a modified development of photography. It is quite expensive and slow and is not often used for routine rep

What are the advantages and disadvantages of a Smart Card?    Advantages of Smart Card: 1. It gives convenience & support for multiple currencies over borders. 2. Used