title: inheritance in c++ gives expected { before class
body: <p>I'm pretty new to C++ and working with books and youtube and here in the same time, but i got a weird problem that I can't find a solution.
  I'm trying to inherit from a base class "Mother" to a derived class Daughter and it is not working for me, it says it need to</p>
  
  <p>This code was taking from TheNewBoston, so thank u Bucky, just giving credits</p>
  
  <blockquote>
    <p>C:\CppProjects\inheritance\Daughter.h|6|error: expected class-name before '{' token</p>
  </blockquote>
  
  <p>I'm adding the main and the classes:</p>
  
  <p>main:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Mother.h"
  #include "Daughter.h"
  using namespace std;
  
  int main()
  {
      Daughter t;
      t.sayName();
  }
  </code></pre>
  
  <p>Mother class:</p>
  
  <pre><code>#include "Mother.h"
  #include &lt;iostream&gt;
  #include "Daughter.h"
  using namespace std;
  Mother::Mother()
  {
  }
  void Mother::sayName(){
      cout&lt;&lt;"I am !!!"&lt;&lt;endl;
  }
  </code></pre>
  
  <p>Mother header:</p>
  
  <pre><code>#ifndef MOTHER_H
  #define MOTHER_H
  class Mother
  {
      public:
          Mother();
          void sayName();
  };
  #endif // MOTHER_H
  </code></pre>
  
  <p>Daughter class:</p>
  
  <pre><code>#include "Daughter.h"
  #include &lt;iostream&gt;
  #include "Mother.h"
  using namespace std;
  Daughter::Daughter()
  {
  }
  </code></pre>
  
  <p>Daughter header:</p>
  
  <pre><code>#ifndef DAUGHTER_H
  #define DAUGHTER_H
  class Daughter : public Mother
  {
      public:
          Daughter();
  };
  #endif // DAUGHTER_H
  </code></pre>
  
  <p>I looked in most of the searches in here and nothing found, I even tried noob style and added std::, it has nothing to do with it.</p>
  
  <p>thank you all of you who are willing to try!</p>
  
  <p>just so you know, when I'm trying to put all of the code in one file, it works great:</p>
  
  <p>the new main:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Mother
  {
  public:
      Mother();
      void sayName(){
          cout&lt;&lt;"I am!!!!"&lt;&lt;endl;
      }
  };
  
  class Daughter: public Mother
  {
  public:
      Daughter();
  };
  
  int main()
  {
      Daughter t;
      t.sayName();
  }
  </code></pre>