I have a function that compares objects by each attribute to see if they are identical. But I was just wondering, would it be better to compare the object by their address inste
You should decide whether your classes are meant to support equivalence or identity. Equivalence is a property typical of values, such as numbers. Identity is a property typical of entities, such as people.
Equivalence is usually determined by comparing the data members of a class; comparing addresses is a reasonable way to check for identity.