Original Post
Can someone please tell me what i'm doing wrong here? code: #include #include "container.h" using namespace std; int main() { int a; Container linkedListTwo; Container linkedList; linkedListTwo.firstItem(4); linkedList.firstItem(4); if ( linkedList == linkedListTwo ) cout << "test" << endl; linkedList.addItem(5); linkedList.addItem(3); linkedList.addItem(8); linkedList.deleteList(); cin >> a; return 0; } bool operator ==(Container a, Container b) { return a.check() == b.check(); } I am trying to compare two different Container objects together. I get the error: no match for 'operator==' in 'linkedList == linkedListTwo' Originally I was trying to do the overloading as a member function but that wasn't working out too well for me. Oh and object.check() sends back an int value from the head node in the object, because each Container object is a linked list.