0

int **p; what is the meaning of this code?

whats that mean?

10th Jul 2016, 2:25 AM
Clyde Bryan
Clyde Bryan - avatar
6 Answers
+ 3
It is a pointer to a pointer.
10th Jul 2016, 3:08 AM
Tony Christopher
Tony Christopher - avatar
+ 3
It is multiple indirection. When a pointer points to other pointer , it is called multiple indirection. for example int x = 3; int *p1 = &x; int **p2 = &p1; int ***p3 = &p2; Access the value of variable by dereferencing pointer. cout<<x<<endl; cout<<*p1<<endl; cout<<**p2<<endl; cout<<***p3<<endl;
10th Jul 2016, 4:18 AM
Dheeraj Kumar Chalotra
Dheeraj Kumar Chalotra - avatar
+ 3
it is a pointer to pointer where a pointer is pointing to the address that us being pointed by another pointer. for example , int x = 5; int *p=&5; int *q=&p;
10th Jul 2016, 9:58 AM
Effat Student
Effat Student - avatar
+ 2
int main(){ int p = 8; int q = 7; int *pp = &p; int *qq = &q; int **pq = &pp; cout << **pq << endl; pq = &qq; cout << **pq << endl; return 0; } Output: 8 7
10th Jul 2016, 3:25 AM
Tony Christopher
Tony Christopher - avatar
0
or a pointer to 2D array. a[][] can also be represented as **a
21st Oct 2016, 10:04 PM
PANKAJ KUMAR
PANKAJ KUMAR - avatar
- 3
Its a pointer ! It stores address of a particular variable unlike normal variable that stores value
10th Jul 2016, 4:09 AM
Vex G Scarlet
Vex G Scarlet - avatar