For a school project, the class was asked to write a String
class to mimic the STL string
class.
I have all the code written, but the linke
You provided the definitions of the operators in the header file which gets included by both String.cpp and test2.cpp.
You should move the definitions into one source file and only provide declarations in the header file.
// in String.h:
bool operator==(const String& left, const char* right);
// in String.cpp:
bool operator ==(const String& left, const char* right) {
return left.compare_to(right)==0;
}