We say Reference are const pointers. Why I am able to assign a new variable to ref B? The below prog
- by sandeep
#include<iostream.h>
int main()
{
int a=10;
int &b=a;
cout<<"B"<<'\n'<<b;
cout<<"A"<<'\n'<<a;
b=100;
cout<<"B"<<'\n'<<b;
cout<<"A"<<'\n'<<a;
int c=20;
b=c;
cout<<"C"<<'\n'<<c;
cout<<"B"<<'\n'<<b;
}