I am trying to overload the insertion operator for a class linked list which is declared as a friend of class node
Code:the errors I get are: 'Linkedlist::head' : cannot access private member declared in class 'Linkedlist' 'Node::value' : cannot access private member declared in class 'Node' Node::next' : cannot access private member declared in class 'Node' the code begins here: ostream& operator<<(ostream out,const Linkedlist& List1) { Node* current=List1.head; while(current) { out<<current->value<<; current=current->next; } return out; }