April
1999 QUESTION 3 Total Marks: 20 Marks |
Click here to access other
questions
Click to access
|
(a) | (i) Differentiate between the terms call by reference and call by value. | [2] |
(ii) Describe the relationship between pointers
and arrays.
|
[2] | |
(b) | Write a procedure which takes two arguments - sum and product - such that the value of sum on exit is equal to the sum of the two values on entry, and the value of
product on exit is equal to the product of the two values on entry.
|
[4] |
(c) | Describe the effect on the following function on
the argument dst, if x and y are null terminated strings, and dst is a sufficiently large character
array. void strfun(char *dst, char *x, char
*y) {
|
[2] |
(d) | Trace the following code segment and write down
the output produced: void main(void) { |
[10] |