Which version of the code will be compiled?
//1
double a = 2.71;
const int &b = a;

//2    
double a = 2.71;
int &b = a;
Explanation
A non-constant reference can only be assigned to an object of the same type as the reference type.

A constant reference can be assigned to an r-value or to an object whose type does not coincide with the reference type.

Следи за CodeGalaxy

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

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