Find Output Q.5

0. The following program fragment   
void main ( )
{
int x=10;
int &p=x;
cout << &p <<  &x;
}     

  • Option : D
  • Explanation : int &p=x aliases p to x. This means they refer to the same memory location. So, the address of x will be same as that of p.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *