What will happen if I re refer a reference in c++ to some other object?
#include<iostrem>
using namespace std;
int main() {
int i,&j=i,k;
i=5;
cout<<i<<endl<<j<<endl;
j=k;
k=10;
cout<<j<<endl;
}
I was expecting an error for this as I have read that we cant re refer a reference to another object but I got 21873, and as many times I am executing this program I am getting different results for last cout.