Program to illustrate Pointer variable



          #include <iostream.h>
           void main( )
          {
               int i = 5 ;
               int * j ;                   // Declaration of Pointer Variable
               j = &i ;                   // Assigning address of variable i to variable j
               cout <<" \n Address of i =  " << &i ;
               cout <<" \n Address of i =  " << j ;
               cout <<" \n Value of i =  " << i ;
               cout <<" \n Value of i =  " << *(&i) ;
               cout <<" \n Value of i =  " << *j ;
           }   

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|