Say I have a linked list node class
class node {
private:
node *next_node;
public:
node *next() const;
};
node *node::next() const {
return next_node;
}
Does next() return a node **next_node or node *next_node. Also what is the significance of either in implementing the list class functions (ie. insert, remove, find)?
The reason I would think it returns a **next_node is because next_node is already a pointer and returning it in a function as a pointer would make it a pointer to a pointer. I read in other questions such as: Linked list head double pointer passing that double pointers also work in list operations so I was a bit confused.