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.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты