"hoox2" <xx*@sss.com> wrote in message news:bl*********@rain.i-cable.com...
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
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003