ok, so my problem is this. I need to copy a custom made list and the function has to be a private member of my list-class. looks like this atm:
private:
struct List_Node* head_;
List* copy(List* list);
looks like crap i know, but i have been told to do it that way. getting the compilation error:
error: `List* List::copy(List*)' is private
is there some way to go around this problem or am i understanding my directions wrong?
You need to call the function from within another member function which is public
.
You cannot call private
member functions from outside the class. The error suggests you are doing that.