title: c++ creating object inside the class
body: <p>I have created 2 classes.One is called Shape and its a virtual class.The other one is called Circle(I intend to create more of them like : triangle,square ....).I want to find circle area of the object,but that isnt important.Here is my problem.When I want to create an object like this :    </p>
  
  <pre><code>vector&lt;Shape *&gt; mStack;
  Shape *newShape = NULL;
  newShape = new Circle(10.6);
  mStack.push_back(newShape);
  </code></pre>
  
  <p>I can create it in the main file without problems.But when I try to create a function of it inside the "Shape" class..like this:</p>
  
  <pre><code>void Shape::Create()
  {
      Shape *newShape = NULL;
      newShape = new Circle(10.6);
      mStack.push_back(newShape);
  }
  </code></pre>
  
  <p>I get following error: <em>syntax error: identifier 'Circle'</em> </p>
  
  <p>... Here are my classes.</p>
  
  <pre><code>#pragma once
  #include &lt;vector&gt;
  
  using namespace std;
  
  class Shape
  {
  
  private:
      vector&lt;Shape *&gt; mStack;
  public:
      Shape();
      ~Shape(void);
  
      virtual double Circle_area() = 0;   
  
  
  };
  
  
  *********************************************************
  
  #pragma once
  #include "Shape.h"
  
  class Circle : public Shape
  {
  private:
      double m_r;
  public:
      Circle();
      Circle(double r);
      ~Circle(void);
  
      double Create();
      double Circle_area();
  };
  </code></pre>
  
  <p>Where is the problem here? How can I create an object inside the parent class? I hope you understand what I am trying to say. Thanks for the help.</p>