Testing of reference binding
Thursday, July 2, 2009
Leave a Comment
If you need more C++ programs then comment. More comments means the more number of programs. Don't forget to tell a friend.... Do you like this website?........Keep connected....
#include<iostream.h>    
#include<conio.h>     
void main()     
{     
clrscr();     
int n=100;     
int *p=&n;     
int &m=*p;     
cout<<"n ="<<n<<"m ="<<m<<"*p ="<<*p<<endl;     
int k=5;     
p=&k;     
k=200;     
cout<<"n ="<<n<<"m ="<<m<<"*p ="<<*p<<endl;     
getch();     
}     
                                          Output     
n=100 m=100 *p=100     
n=100, m=100 *p=200
 
 


 
0 comments »
Leave your response!