795 B
795 B
-
Suppose that the following declarations are in effect:.... a.
14b.34c.4d.truee.false -
Suppose that
high,low, andmiddleare all pointer variables of the same type, and thelowandhighpoint to elements of an array. Why is the following statement illegal, and how could it be fixed?
middle = (low + high) / 2
The above statement is illegal because you can't add an int * to an int *. The below operation is legal because you can perform pointer subtraction, and because low is defined on the left hand side of the equation, then adding a long to a pointer is valid.
middle = low + (high - low) / 2;
- What will be the contents of the
aarray after the following statements are executed?
{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}