Let Us have something which is quite interesting, but many students are scared of and afraid of doing.
YES YES you are getting it right, I am Posting one of the most interesting Post which will make a word like “POINTER” Very much easy in compare to other feature of C Language. With This post i will make you understand the following things
- Pointer variable
- Pointer of pointer (double pointer that stores the address of another pointer variable)

#include <stdio.h> int main() { int a=10, *p,**q; p=&a; q=&p; clrscr(); printf("\na=%d *p=%d **q=%d", a, *p, **q);// all prints 10 printf("\n&a=%d p=%d *q=%d", &a, p, *q); // all prints address of a - 1000 printf("\n &p=%d q=%d", &p, q); // prints address of p - 2000 printf("\n &q=%d", &q); // prints address of q printf("\na=%d &a=%d", a, &a); // value of a and its address printf("\n*p=%d p=%d &p=%d", *p, p, &p); //*p means value at address 1000 p means value of p. printf("\n**q=%d *q=%d q=%d &q=%d", **q, *q, q, &q); //**q means value at address of 1000 //E.g. // &p- address of Variable // p - value of variable // *p - value at address that variable preserved // **p- value at address of address return 0; } output: (as per above figure) a=10 *p=10 **q=10 &a=1000 p=1000 *q=1000 &p=2000 q=2000 &q=3000 a=10 &a=1000 *p=10 p=1000 &p=2000 **q=10 *q=1000 q=2000 &q=3000
If you have any query or suggestion regarding pointer please comment for the above post, we will be glad to see a comment and will try to solve your query as soon as possible.
I don’t be able to understand the double pinter…how it’s works,…can u pls explain it…in brief
Dear Gopal,
Double pointer store address of another pointer variable. Here we take double pointer as **q and it stores the address of p, address access by prefix character ‘&’ of variable so we write here q=&p;, value of q is 2000 which is the address of p, and *q means print the value at address 2000, so it will print 1000, and **q it will first access the value of q, then value at address 2000 means *q=1000, then value at address 1000 means **q=10. Please refer figure with this it will beneficial to understand quickly. I hope you understand and if you any query still you can ask.