Computer Science, asked by priyanka4384, 1 year ago

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 jagdish725
11

Answer:

2.func(array[size]);

Answered by adventureisland
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