title: Error: Expected a Type Specifier. C++ Inheritence
body: <p>I've been working on creating Shape class files for my class, and up until about 15 additional lines of code, everything was going well. I'm getting one of the standard "Expected type specifier" when I create a 'Rectangle' object. Creating objects of the other two classes (Triangle and Circle) work perfectly. I noticed it bugged out as soon as I added the second vector (shapesTest2), so maybe it has something to do with that?</p>
  
  <p>Specifically, the lines in question are:</p>
  
  <pre><code>shapes.push_back(new Rectangle(1, 2, 3, 4, Blue));
  shapesTest2.push_back(new Rectangle(11, 22, 33, 44, Black));
  </code></pre>
  
  <p>The error list says:</p>
  
  <pre><code>    IntelliSense: expected a type specifier     29
      IntelliSense: expected a type specifier     30
  Error 1 error C2661: 'std::vector&lt;_Ty&gt;::push_back' : no overloaded function takes 5 arguments   31
  Error 2 error C2143: syntax error : missing ';' before ')' 31
  Error 3 error C2061: syntax error : identifier 'Rectangle' 31   
  </code></pre>
  
  <p>Anyways, here's the code in the main.cpp file.:</p>
  
  <pre><code>// main.cpp - Shape class test program
  // Written by _______
  #include &lt;vector&gt;
  #include &lt;Windows.h&gt;
  #include "Circle.h"
  #include "Triangle.h"
  #include "Rectangle.h"
  
  
  using namespace std;
  
  void main()
  {
      // Container of Shapes
      vector&lt;Shape*&gt; shapes;
      vector&lt;Shape*&gt; shapesTest2; // Used for second test case of Move and Scale.
  
      // Must allocate my object on heap now
  
      Circle *myCircle = new Circle(10, 10, 100, Red);
      shapes.push_back(myCircle);
  
      // Create new, unnamed stack-allocated instance of a Circles and push_back() to vector
      shapesTest2.push_back(new Circle(20, 20, 20, Red));
  
      // Populate the Container with 2 Rectangles
  
      shapes.push_back(new Rectangle(1, 2, 3, 4, Blue));
      shapesTest2.push_back(new Rectangle(11, 22, 33, 44, Black));
  
      // Populate the Container with 2 Triangles
  
      shapes.push_back(new Triangle(3, 4, 5, 7, 15, 4, Black));
      shapesTest2.push_back(new Triangle(6, 7, 9, 8, 43, 15, Green));
  
  // There's more to the file, but this is the only time this pops up, and the rest is
  // just messing around with the vector&lt;Shape*&gt;. I figured I'd try and save time and
  // space by only posting what's needed, but if you think that the error is caused by
  // code below, ask me and I'll upload the rest of this main.cpp file
  
  }
  </code></pre>
  
  <p>And for reference, here's my Rectangle.h file:</p>
  
  <pre><code>#pragma once
  
  #include &lt;string&gt;
  #include "Shape.h"
  
  using namespace std;
  
  // Enum Colors = {Red, Blue, Green, Black, White}; is located in "Shapes.h"
  
  class Rectangle : public Shape
  {
  public:
  Rectangle(int x, int y, int width, int height, Colors color) : Shape(x, y, color)
  {
      Width = width;
      Height = height;
  }
  
  virtual void Scale(float scaleFactor)
  {
      Width = int(Width*scaleFactor);
      Height = int(Height*scaleFactor);
  }
  
  virtual void Draw() const // const b/c it doesn't alter Radius, X, Y, nor Color
  {
      cout &lt;&lt; "Rectangle of width " &lt;&lt; Width &lt;&lt; " and height " &lt;&lt; Height &lt;&lt; " with the top left corner at (" &lt;&lt; X &lt;&lt; ", " &lt;&lt; Y &lt;&lt; ") and color " &lt;&lt; GetColor() &lt;&lt; ".\n" &lt;&lt; endl;
  }
  
  private:
  int Width;
  int Height;
  };
  </code></pre>
  
  <p>Thanks for all the help guys, I've tried reading through all the other questions and it looked like people had just forgotten the '#include "<em>_</em>"' part of it.</p>