title: How do I compare a char array from a class with another char array using the overload == operator?
body: <p>I have a class called Airplane with a private data member thats a char array.</p>
  <pre><code>// char array variable in my class
  char* name{nullptr};
  </code></pre>
  <p>my goal is to compare for equality this variable and an input variable of type const char [].</p>
  <p>my overload function looks like this:</p>
  <pre><code>bool Airplane::operator==(const char input_name[]) const{
      if (this-&gt;name == input_name) {
           return true;
       }
  return false;
  }
  </code></pre>
  <p>By overloading the == operator, I want to be able to do the following:</p>
  <pre><code>Airplane plane(&quot;hello&quot;);
  if (plane == &quot;hellooo&quot;) {
     // do something
  }
  </code></pre>
  <p>I want to be able to create a class with a text variable like &quot;hello&quot; and then be able to == it to any random text I want to compare equality. Right now my code just doesnt work, it runs and then ends in the console with no errors. basically I need to compare to char arrays, one within the class the overload function is built in, and another given as input by the user. Thank you for any help.</p>