title: error C2011: 'class type redefinition - Basic Inheritance
body: <p>Below are by 4 classes, I'm learning about basic c++ syntax and boy is it much harder and less forgiving than other languages I have used. I have a main class, base class "BaseArray" and two sub classes "OrderedArray" and "UnorderedArray".</p>
  
  <p>Main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "OrderedArray.cpp"
  #include "UnorderedArray.cpp"
  
  using namespace std;
  
  int main() {
  
  
      system("PAUSE");
      return 0;
  }
  </code></pre>
  
  <p>BaseArray.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class BaseArray {
      public:
          BaseArray::BaseArray() {
  
          }
  };
  </code></pre>
  
  <p>OrderedArray.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "BaseArray.cpp"
  
  using namespace std;
  
  class OrderedArray : public BaseArray {
      OrderedArray::OrderedArray() {
  
      }
  };
  </code></pre>
  
  <p>UnorderedArray.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "BaseArray.cpp"
  
  using namespace std;
  
  class UnorderedArray : public BaseArray {
      UnorderedArray::UnorderedArray() {
  
      }
  };
  </code></pre>
  
  <p>The errors I receive are as followed, from scouting other threads online. I think it might have to do with duplicate calling of classes. To be honest, I have no clue. If someone could point me in the right direction that would be nice, thanks in advance!</p>
  
  <pre><code>error C2011: 'BaseArray':'class' type redefinition
  error C2504: 'BaseArray':base class undefined
  </code></pre>
  
  <p>To fix this error I can remove one of the includes at the top of main.cpp, but I need those to create objects and call functions from the subclasses later on.</p>