|
C Programming Reference >> C Programming Reference Question Bank >> 19/07/07 - 361 Views - Ratings : Question -
What will be the output of the following code and why?
Answer - 5 5 5 5 Explanation - First thing to note is p in above c code is an array of pointer to a function. Second thing to observe is f1 and f2 are exactly alike in all aspects. Third thing to see is that a is passed by refrence and b is passed by value. And finally since value of a is passed by refrence and that of b is passed by value, value of a can be modified to b while actual value of b cannot be modified to a. So all we get is 5 for both the variables every time. Reader Comments -
|
|||