title: Operator overloading in header files and in the cpp files
body: <p>I got an error, when I am trying to overload an operator.</p>
  
  <p>My header file:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  using namespace std;
  
  #ifndef HALLGATO_H
  #define HALLGATO_H
  
  class Hallgato {
      private:
          char* nev;
          char* EHA;
          int h_azon;
          unsigned int kepesseg;
      public:
          friend ostream&amp; operator&lt;&lt;(ostream&amp; output, const Hallgato&amp; H);
  };
  #endif
  </code></pre>
  
  <p>My cpp file:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include "Hallgato.h"
  using namespace std;
  
      ostream&amp; Hallgato::operator&lt;&lt;(ostream&amp; output, const Hallgato&amp; H) {
          output &lt;&lt; "Nev: " &lt;&lt; H.nev &lt;&lt; " EHA: " &lt;&lt; H.EHA &lt;&lt; " Azonosito: " &lt;&lt; H.h_azon &lt;&lt; " Kepesseg: " &lt;&lt; H.kepesseg &lt;&lt; endl;
          return output;
      }
  };
  </code></pre>
  
  <p>In my .cpp file, when I want to define the overloaded operator <code>&lt;&lt;</code>, I got an error. Why?</p>