Hi, I am trying to overload the = operator on a simple C++ class called Set that contains a dynamic array of ints. For the = operator, I first want to check for self assignment, so I wanted to compare 2 pointers to make see if they have the same memory address. Here's the code:
Set& Set::operator=(const Set& setEqual)
{
//first check for self assignment
if(setEqual == this*)
cout << "this is self assignment";
}
The error spat out is error: expected primary-expression before ')' token
I believe I'm having a misunderstanding of pointers again, so if anyone could point (ha!) me in the right direction, I'd appreciate it.