Ask Question

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

+3
Answers (1)
  1. 3 July, 15:09
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers