+ 9

Difference between *p , **p, ***p ?

13th Feb 2018, 12:20 PM
Prachi Chauhan
Prachi Chauhan - avatar
9 odpowiedzi
+ 13
*p « pointer **p « pointer to a pointer ***p « pointer to a pointer to a pointer That last one is a mouthful, makes pointer start to sound weird :D
13th Feb 2018, 12:36 PM
jay
jay - avatar
+ 13
Thanks,1st two ... clear. How last one works ? I mean where do we need to use ***p.
13th Feb 2018, 12:41 PM
Prachi Chauhan
Prachi Chauhan - avatar
+ 11
Got it,Thanks alot sir .
13th Feb 2018, 12:47 PM
Prachi Chauhan
Prachi Chauhan - avatar
+ 11
Fun fact: You can have an arbitrary number of '*'s.
13th Feb 2018, 12:56 PM
Hatsy Rei
Hatsy Rei - avatar
+ 5
The first p has only one *. The second p has two *. The third p has the most *. It has 3, I repeat 3, *s. Apologies... I couldn't resist posting this answer. 😂 Seriously though... The other ppl answered this question appropriately.
13th Feb 2018, 12:47 PM
David Carroll
David Carroll - avatar
+ 4
*p holds the address of the declared variable to *p **p is called pointer to a pointer that means it (**p) holds the address of *p ***p is called pointers to a pointers to a pointers that holds the address of **p
13th Feb 2018, 12:26 PM
Aditya Narayan Mishra
Aditya  Narayan Mishra - avatar
+ 4
https://www.quora.com/What-is-the-difference-between-*p-**p-***p-in-pointers u can clear your doubt here 😊😊
13th Feb 2018, 12:43 PM
Aditya Narayan Mishra
Aditya  Narayan Mishra - avatar
+ 2
***p stores the address that is assigned with **p
13th Feb 2018, 12:42 PM
Aditya Narayan Mishra
Aditya  Narayan Mishra - avatar
+ 2
If you use *p for a one dimensional array, you'd use **p for a 2d one, ***p for a 3d one, ****p for a 4d one etc.
13th Feb 2018, 1:02 PM
Vlad Serbu
Vlad Serbu - avatar