retagged by
2,037 views
1 votes
1 votes

When an array is passed as a parameter to a function which of the following statements is correct?

  1. The function can values in the original array
  2. The function cannot values in the original array
  3. Results in compilation error
  4. Results in run-time error
retagged by

1 Answer

Best answer
5 votes
5 votes

Answer would be A) The function can change value in the original array

Because when we are passing array in C, we will pass it by reference. Hence whatever changes we made in called function, that will be reflected in calling function.

selected by
Answer:

Related questions

3 votes
3 votes
1 answer
1
go_editor asked Jul 17, 2016
1,710 views
Arrays in C language can have ____ with reference to memory representation.n-subscriptstwo-subscriptsonly one subscriptthree subscripts only
3 votes
3 votes
2 answers
2
go_editor asked Jul 18, 2016
3,238 views
Match the following $:$$\begin{array}{} \text{a.} & \text{calloc()} & \text{i.} & \text{Frees previously allocated space} \\ \text{b.} & \text{free()} & \text{ii.} & \te...
1 votes
1 votes
2 answers
4
go_editor asked Jul 18, 2016
1,255 views
Trace the error:void main() { int *b, &a; *b=20; printf(“%d, %d”, a, *b) }No errorLogical errorSyntax errorSemantic error