The operator == cannot be overloaded to compare two arrays consisting of characters using string comparisons. It should be noted that out of the two operands of an overloaded operator, at least one operand should be of user- defined type. This user-defined type usually refers to a class.
Two characters can be compared easily using classes, such as std::string, rather than using an array containing characters.
No comments:
Post a Comment