+ 1

what is double pointer

Why we have to pass double pointer in linked lists...what is advantage of that? What will happen if we didn't use double pointer. Plz explain with example if possible

20th Dec 2016, 8:28 AM
Manikanta Nallamalli (Mittu)
Manikanta Nallamalli (Mittu) - avatar
5 Réponses
+ 3
https://code.sololearn.com/c6ckq8konlB9/ An example if you need one
20th Dec 2016, 8:47 AM
Gabe Rust
Gabe Rust - avatar
+ 1
By double pointer, do you mean pointer to pointer, or pointer to double?
20th Dec 2016, 8:42 AM
Gabe Rust
Gabe Rust - avatar
+ 1
The idea is that a linked list can grow and shrink. Each node is a struct that contains a pointer to the next struct
20th Dec 2016, 8:46 AM
Gabe Rust
Gabe Rust - avatar
+ 1
Tnx guys :) so finally, its like ....if we use single pointer, it is similar to copying a pointer which doesn't affect changes in calling function
21st Dec 2016, 7:21 PM
Manikanta Nallamalli (Mittu)
Manikanta Nallamalli (Mittu) - avatar
0
yes...its pointer to pointer..many standard books are using double pointer in linked lists
20th Dec 2016, 8:43 AM
Manikanta Nallamalli (Mittu)
Manikanta Nallamalli (Mittu) - avatar