Machine-translated by Google. Questions are authored in English.
Top

Discussion

Choose the correct statements 

  • A.an entire array can be passed as an  argument to a function
  • B.a part of an array can be passed as argument to a function
  • C.any change done to an array that is passed as an argument to a function will be local to the function
  • D.Both (a) & (b)

Answer: D

Correct answer: Both (a) & (b)

(a) An entire array is passed simply by naming it, which hands over its base address. (b) A part can be passed just as easily, by passing the address of an interior element - f(&a[3], n) gives the function the tail of the array. (c) is false: since the function holds the caller’s address, changes it makes are not local - they are visible to the caller.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.