Program for integer pointer type


#include <iostream.h>
#include<conio.h>
void main()
{
    int i=5;
    int *p;
    clrscr();
    p=&i;
    cout<<"Value of i : "<<i;
    cout<<"\nValue of i : "<<*p;
    cout<<"\nValue of i : "<<*(&i)<<"\n";

    cout<<"\nAddress of i : "<<&i;
    cout<<"\nAddress of i : "<<p<<"\n";

    cout<<"\nValue of p: "<<p;
    cout<<"\nValue of p: "<<*(&p);
    cout<<"\nAddress of p: "<<&p;

    getch();
}

0 comments:

Post a Comment

 
 
 
 


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