407 views
0 votes
0 votes
an array can be passed in a function in C through

a)call by value only    b)call by reference only  c)both by call by value and call by reference d) none

2 Answers

0 votes
0 votes
An array is passed in a function by call by reference method. The name of the array acts as the reference for the array.

e.g. traverse(a,10);// function call by passing array name as reference

An array element can be  passed as call by value.

e.g. traverse(a[4],10);// function call by passing  individual element using call by value

So, option (b) is correct.

Related questions

1 votes
1 votes
1 answer
1
Mrityudoot asked Feb 2
289 views
In what cases does an uninitialized array have values = 0 and for which cases does it have values = garbage values. How to differentiate?
1 votes
1 votes
1 answer
2
Mrityudoot asked Feb 2
175 views
Does C support fractional Indices?float x = some fraction;Is float a[x] valid declaration?
1 votes
1 votes
1 answer
3
amitarp818 asked Oct 25, 2023
426 views
How is the address written for 3-dimensional arrays?In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow??Also, how ...