Ask Question
2 April, 11:12

Which of the following function declarations correctly expect an array as the first argument?

Question 1 options:

void f1 (int array, int size);

void f1 (int& array, int size);

void f1 (int array[100], int size);

void f1 (float array[], int size);

All of the above

C and D

A and B

+5
Answers (1)
  1. 2 April, 11:25
    0
    Only

    Option: void f1 (float array[], int size);

    is valid.

    Explanation:

    To pass an array as argument in a function, the syntax should be as follows:

    functionName (type arrayName[ ])

    We can't place the size of the array inside the array bracket (arrayName[100]) as this will give a syntax error. The empty bracket [] is required to tell the program that the value that passed as the argument is an array and differentiate it from other type of value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following function declarations correctly expect an array as the first argument? Question 1 options: void f1 (int array, int ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers