December
1999 QUESTION 5 Total Marks: 15 Marks |
Click here to access other
questions
Click to access |
(a) |
Given the following definition of the function foobar :
(i)Describe the effect of calling the function foo with an arbitrary array a containing b values.[3marks ]
|
[6] | ||||||||||||
(b) |
Write a function,called last ,the signature of which is given below,which takes an integer parameter x .The procedure should simply return the value which was passed in as a parameter the previous time it was called,or 0 if it is called for the first time. int last(int x);
|
[4] | ||||||||||||
(c) |
Write a procedure,called minmax ,the signature of which is given below,which takes three arguments:w ,an integer array,x ,which is an integer specifying the size of the array,and y and z which are pointers to integers.On exit,y should point to the smallest value in the array,and z should point to the largest.The array x should remain unchanged. void minmax(int w [ ], int x , int* y , int* z); |
[5] |