This one is on References.
in the above link (from IBM), they clearly mention that a reference to a (pointer to a reference ) is not allowed.They also say that a reference to other references is not allowed. However, when i tried out both these cases in code, it worked on VC++.
Can you please help me with this ?
I have the snippet for you right below.
// reference to other references
int a = 10;
int& b = a;//b is a ref to a
int& c = b;// c is a ref to b which is a ref
cout << c;// i get the output as 10
////////////////////////////////////////////////////////////////////////////////////////
// reference to ( Pointer to a Reference )
int a = 10;
int& b = a;//b is a ref to a
int* p=&b;// pointer to a reference
cout << *p <<endl; // output is 10
int** ptr=&p;// Pointer to a (Pointer to a Reference)
cout << **ptr;//output is 10