3 ms·
There is no extra layer of indirection. The idea here is to make the "p" pointer point on the "next" field of the current element instead of at the structure i
by GuB-42 6y ago
There is no extra layer of indirection.
The idea here is to make the "p" pointer point on the "next" field of the current element instead of at the structure itself. There is the same amount of indirection in both solutions.
The first solution does pointer->structure->pointer, the "elegant" solution does pointer->pointer->structure. The reason the first one may be easier to read is because the C syntax "prefers" it, as it is a more common construct.