H
hoox2
void push_front(Node const*& head, int data);
Can someone tell me what it means for "const*&"? A reference or a pointer?
Can someone tell me what it means for "const*&"? A reference or a pointer?
hoox2 said:void push_front(Node const*& head, int data);
Can someone tell me what it means for "const*&"? A reference or a pointer?
hoox2 said:void push_front(Node const*& head, int data);
Can someone tell me what it means for "const*&"? A
reference or a pointer?
Can someone tell me what it means for "const*&"? A reference or a pointer?
Jonathan Mcdougall said:pointer?
A const reference to a pointer. The function probably reset your pointer
to 0, meaning it takes ownership of the object, though the name 'head' makes
me wonder about that.
Nope...it's a reference to a pointer to a constant Node object, not a const
reference.
The const keyword could go in front of the Node and it would be the same,
but otherwise read it from right-to-left to get:
reference-to-pointer-to-const-Node.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.