How to check if my string is equal to null?

As further comment, you should be aware of this term in the equals contract: From Object.equals(Object): For any non-null reference value x, x.equals(null) should return false. The way to compare with null is to use x == null and x != null. Moreover, x.field and x.method() throws NullPointerException if x == null.

C++ error: definition of implicitly-declared

Declare the parameterless constructor in the header file: You are defining it in the .cpp file without actually declaring it. But since the compiler provides such a constructor by default (if no other constructor is declared), the error clearly states that you are trying to define an implicitly-declared constructor.