Why do most C examples pass a double pointer when manipulating linkedlists? Why can not we just pass a single pointer to the struct?
I think using an external reference accessor for a linked list would be a more appropriate solution, yes or no?
Why do most C examples pass a double pointer when manipulating linkedlists? Why can not we just pass a single pointer to the struct?
I think using an external reference accessor for a linked list would be a more appropriate solution, yes or no?
In order to change a function parameter value inside a C function you must pass a pointer to it.
If the value to be changed is a pointer you need to pass a pointer to it; therefore ** is used.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson