title: Why is inherited member not allowed?
body: <p>I'm beginner to C++ and I'm doing one of the exercises about abstract class and inheritance.</p>
  
  <p>This is my abstract class:</p>
  
  <pre><code>#ifndef   SHAPE_H 
  #define  SHAPE_H
  class Shape
  {
      public:
          virtual void area();
          virtual void perimeter();
          virtual void volume();
  };
  #endif
  </code></pre>
  
  <p>This is my concrete class that implements the abstract class:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  #include "Shape.h"
  using namespace std;
  
  class Circle : public Shape
  {
      public:
          Circle(int);
      private:
          int r;
  };
  
  Circle::Circle(int rad)
  {
      r = rad;
  }
  
  void Circle::area()
  {
      cout &lt;&lt; "Area of this cirle = " &lt;&lt; 3.14 * pow(r, 2) &lt;&lt; endl;
  }
  
  void Circle::perimeter()
  {
      cout &lt;&lt; "Perimeter of this cirle = " &lt;&lt; 2 * 3.14 * r &lt;&lt; endl;
  }
  
  void Circle::volume()
  {
      cout &lt;&lt; "Volume is not defined for circle." &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I got red lines under <code>area()</code>, <code>perimeter()</code>, and <code>volume()</code> in my <code>Circle</code> class, which showed <code>"Error: inherited member is not allowed"</code>. I went through my class ppt and googled for answer but no luck. Any help is appreciated.</p>