Which of the following is the correct syntax to send an array as a parameter to function?
func(*array);
func(array[size]);
func(&array);
func(#array);
Answers
Answered by
11
Answer:
2.func(array[size]);
Answered by
0
Option (3) is correct.
The proper syntax for passing an array as an argument to the function is func(&array);
About syntax for passing an array to a function :
- When an array is supplied as a parameter to a function, the function has the ability to modify the contents of the original array.
- To send an array as a parameter to a method, just type the array's name without the square brackets. To accept an array type parameter, the method prototype must match.
- The proper syntax for passing an array as an argument to the function is func(&array);
Similar questions