Can anyone help me... what is the difference between int *ptr and int **ptr.? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone help me... what is the difference between int *ptr and int **ptr.?

25th Mar 2016, 3:15 PM
REIFFORD NONGBRI
2 Answers
+ 1
Let say int *p=&x; and x=5;. And there is this thing : int *a=&p; so when u cout <<"*p"; the value is 5 and when cout<<"**a"; executes answer is also 5
6th May 2016, 6:23 PM
Raju Gautam
Raju Gautam - avatar
+ 1
*ptr is pointer to a variable and **ptr is pointer to the pointer. **ptr is called double pointer used for indirect access. Raju has explained it with example
15th Jun 2016, 7:08 AM
Popat
Popat - avatar