Lynn McGuire said:
The Highest-Level Feature of C is?
Think about your answer before visiting:
http://prog21.dadgum.com/166.html
Shocked me.
Don't be too shocked - the web page content is just an opinion. Which
feature would you have selected?
The author of that web page does have a good point. A switch statement can
be implemented in different ways. However, I'm not sure I would completely
agree. There are other viewpoints to consider. Here are a few of them:
For probably all C constructucts the implementation is not defined. For
example, given a series of 'if' statements if the tests were disjoint and
discrete a compiler could rewrite them as a jump table just as it might for
a normal switch statement. In a sense, then, neither is higher level than
the other.
As well as having a high-level element C's switch can be considered
particularly *low* level. Rather than selecting one of a number of
alternatives C's switch might be better understood as a multiway jump. This
is evidenced by the requirement for break statements and that switch cases
can be interleaved with other constructs. The interleaving is particularly
weird and unstructured - and low level.
An alternative candidate for the highest level feature of C (and the one I
thought of - as you told us to do - before clicking the link) is the
function call. There are many ways that parameters can be passed and results
returned. The compiler is free to choose how to interface functions based on
what it knows of caller and callee.
Possible other alternatives might be the initialisation of arrays and
structures or the manipulation of structures as units.
James