Syntax for implementing a function that returns a pointer
I have a List class with a function that returns a pointer value and it is declared as follows in a header file:
Code:
Node *Find(int key);
I want to implement this function but I have no idea how to do it properly when the return type is a pointer. A thought it might be something a long the lines of:
Code:
// in the .cc file
List::Node *::List::Find(int key)
{
// My implementation code
return nodePtr;
}
However, this doesn't work and my searches for something similar have come up blank thus far. Thank you so much for your help!
Best regards.