Object as attributte of another object c++
<p>I  have the main class "arm", it has many attributes like long or elbow, but it has as an attribute one object of the class "hand". Hand has different methods and attributes so it´s important to make it as a different class.</p>

<p>My question is how to use an object as an attribute of another class on c++? (i´m using Microsoft Visual Studio)</p>

<p>the class hand is</p>

<p>on hand.h</p>

<pre><code>class hand
{
 private:
      int number_of_fingers;
 public:
      void handleSomthing();
}
</code></pre>

<p>and the class arm is</p>

<p>on arm.h</p>

<pre><code>#include "hand.h"
class arm
{
 private: 
      float long;
      int elbow;
      hand right;
}
</code></pre>

<p>But when I include "hand.h" on arm an error occurs saying </p>

<blockquote>
  <p>error C2011: 'hand': new definition of type 'class'</p>
</blockquote>

<p>If I try to use hand.h and create and use objects on the main program it works, so the problem is not on the class hand I think.</p>

<p>I´m trying to learn OOP and I´ll really appreciate your help </p>