title: unknown type name 'class'
body: <p>I'm creating a small library for several geometric shapes. Doing so, I'm writing down prototypes into a <code>shapes.h</code> file and the methods into a <code>shapes.cpp</code> file.
  This is the header: </p>
  
  <pre><code>#ifndef __shapeslib
  #define __shapeslib
  
  class Shape{
  protected:
    struct dimensions{
      double heigth;
      double width;
    };
    double radius;                        // for circle class to be inherited
  
  public:
    Shape(double heigth, double width);   // Constructor
    Shape(const Shape &amp; shape);           // copy constructor for class
    ~Shape();                             // Destructor
  
    virtual double area(double heigth, double width);
    virtual double perimeter(double heigth, double width);
    void height();
    void width();
    double rotate(double heigth, double width);
  };
  </code></pre>
  
  <p>But when saving the file in Atom software, I get these two errors for the line <code>class Shape{</code></p>
  
  <p><code>unknown type name 'class'</code></p>
  
  <p><code>expected ';' after top level declarator</code></p>
  
  <p>I read <a href="https://stackoverflow.com/questions/16336244/unknown-type-name-class">here</a> that could be because I'm compiling in C rather than C++. I sincerely have no idea about how to avoid this (still a beginner).</p>
  
  <p>I also tried to change the file name from <code>.h</code> to <code>.hpp</code> and seems working. Unfortunately, I must have a <code>.h</code> header file.</p>
  
  <p>Any feedback is really appreciated.
  Thanks everyone. </p>