0

What is advantage of using Double Pointer?

I am learning c language these days. Learned pointers, came across double pointers. By the way, I've learned that double pointers are useful when used in the middle. Can someone please post the reason and tutorial or examples?

22nd Feb 2022, 2:04 PM
Kevin Kim
Kevin Kim - avatar
5 ответов
+ 1
Here’s a more detailed expalanation : https://flylib.com/books/en/1.474.1.19/1/ 😊
23rd Feb 2022, 1:48 AM
A J
A J - avatar
+ 1
By double pointer you mean pointer to pointer ( **ptr) or pointer to double type ( double *ptr) ?
22nd Feb 2022, 2:15 PM
Arsenic
Arsenic - avatar
0
Arsenic oh,, pointer to pointer!
22nd Feb 2022, 2:31 PM
Kevin Kim
Kevin Kim - avatar
0
With double pointers You can reorganize tons of data in the memory by simply referring to the memory address A Pointer as the name implies points to a location in the memory. It holds the address of the variable it is pointing to. Single pointer directly points to address of the variable. Double pointer points to address of another location which holds address of the variable. Its like double linking (like done while referring to multidimensional arrays).
22nd Feb 2022, 4:01 PM
A J
A J - avatar
0
A J "Indirection with pointers increases flexibility by allowing multiple manipulations in intermediate steps." I don't understand this explanation.
23rd Feb 2022, 1:05 AM
Kevin Kim
Kevin Kim - avatar