While transferring the array by reference, what is displayed on the screen as a result of the execution of the ​program with the following code?
#include <iostream>

using namespace std;

void f(int (&a)[11])
{
    cout << sizeof(a) << endl;
}

int main()
{
    int a[10];
    cout << sizeof(a) << " ";
    f(a);

    return 0;
}
Explanation
While transferring the array by reference, the dimension of the transferred array and specified array in the parameters of the function should be the same.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes