A pointer is derived data type in C. It is built one of the fundamental data types available in C. Pointer contains memory addresses as their values. Since these memory addresses are the computer memory where program instructions and data are stored, pointers can be used to access and manipulate data stored in the memory.
eg:-
//program
#include<stdio.h>
#include<conio.h>\
void main()
{
char a;
int x;
float p, q;
printf("%c is stored at addr %u.\n",a,&a);
printf("%d is stored at addr%u.\n",x,&x);
printf("%f is stored at addr%u.\n",p,&p);
printf("%f is stored at addr%u.\n",q,&q);
getch();
}
eg:-
//program
#include<stdio.h>
#include<conio.h>\
void main()
{
char a;
int x;
float p, q;
printf("%c is stored at addr %u.\n",a,&a);
printf("%d is stored at addr%u.\n",x,&x);
printf("%f is stored at addr%u.\n",p,&p);
printf("%f is stored at addr%u.\n",q,&q);
getch();
}
No comments:
Post a Comment