When an array is passed as parameter to a function,


UGCNET-Dec2014-II-14




When an array is passed as parameter to a function, which of the following statements is correct ?
  1. The function can change values in the original array. 
  2. In parameters are passed by value, the function cannot change the original value in the array. 
  3. It results in compilation error when the function tries to access the elements in the array. d
  4. Results in a run time error when the function tries to access the elements in the array. 

Comments

  1. Ans A) Function can change the value of original array

    When array is passed to a function with it's starting address , it's value can be modified by the function call

    Pass by value in C is not only problem for array , it causes problem for even for single variable in function call

    ReplyDelete

Post a Comment

Popular Posts