mercredi 1 mai 2019

Why a reference is said to be unchanged in C++ primer 5th, how ever this following code works?

In the book, we explain that there is no way to make a reference refer to different object, how ever the following code works for c++ 11.

int i1 = 1, i2 = 0;
int &ri = i1;
ri = i2;

Aucun commentaire:

Enregistrer un commentaire