This might be obvious for some but i really could not get around it
Inside Material
I overloaded == operator :
`
class
Material{
int id;
int count;
double price;
string name;
Material() {
}
Material(int id) {
this->id = id;
}
Material(int id,int count,double price,string name) {
this->id = id;
this->count = count;
this->name = name;
this->price = price;
}
string getName() {
return name;
}
bool operator==(Material& obj)
{
if (this->name == obj.getName())return true;
else return false;
}`
And when ever i do smth similar to this : if(obj ==NULL){...}
The program stops and throws an exception.
Exception thrown at 0x0F61D6F0 (ucrtbased.dll) in TradingVendors.exe: 0xC0000005: Access violation reading location 0x00000000.
How can i possibly fix this? thanks