recategorized
1,521 views
3 votes
3 votes

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 $C$, 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. 
  4. Results in a run time error when the function tries to access the elements in the array. 
recategorized

1 Answer

Best answer
1 votes
1 votes
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
selected by
Answer:

Related questions

3 votes
3 votes
3 answers
1
2 votes
2 votes
2 answers
3
makhdoom ghaya asked Jul 20, 2016
3,306 views
What will be the output of the following $'C'$ code ?main () { int x = 128; printf ("\n%d", 1+x++); }$128$$129$ $130$ $131$
2 votes
2 votes
1 answer
4
makhdoom ghaya asked Jul 24, 2016
1,564 views
Match the following $:$ $\begin{array}{clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Call Control protocol} &\text{i.} & \text{Interface b...