#include<iostream>
#include<conio.h>
using namespace std;
int main ()
{
int a= 5;
/* actual variable declaration */
int *ptr;
/* pointer variable declaration */
ptr = &a;
/* store address of a in pointer variable*/
cout<<"Address of variable a="<< &a;
cout<<"\nAddress stored in variable ptr="<<ptr;
cout<<"\nValue of *ptr variable="<<*ptr;
getch();
return 0;
}
#include<conio.h>
using namespace std;
int main ()
{
int a= 5;
/* actual variable declaration */
int *ptr;
/* pointer variable declaration */
ptr = &a;
/* store address of a in pointer variable*/
cout<<"Address of variable a="<< &a;
cout<<"\nAddress stored in variable ptr="<<ptr;
cout<<"\nValue of *ptr variable="<<*ptr;
getch();
return 0;
}
No comments:
Post a Comment