hoox2 said:
void push_front(Node const*& head, int data);
Can someone tell me what it means for "const*&"? A
reference or a pointer?
Except for an initial const, these kinds of types should be
understood from left to right:
Node const x; // a const object of type Node
Node const* x; // a pointer to a const Node object
Node const* &x; // a reference to a pointer to a const Node
My guess is that push_front() is an operation that works
on lists, which is probably why it takes head by reference.
Since the function probably doesn't need to modify the
pointed-to Node object, it takes that as const. Since it
is probably going to modify the head pointer, it takes
that as non-const &.
Dave