title: Using an instance of a class inside another class
body: <p>Here is a simplified version of what I'm trying to do</p>
  
  <pre><code>class Firstclass
      {
      public:
      Firstclass(int x)
          {
          //do things with x;
          }
      };
  
  class Secondclass
      {
      public:
      Secondclass()
          {
          Firstclass a(10);
          }
  
      void func()
          {
          //Do things with a
          }
  
      private:
      Firstclass a;
      };
  </code></pre>
  
  <p>So I have a class (Firstclass) with a constructor that takes an int argument. Now I'd like to create an instance of that class inside the constructor of another class (Secondclass).</p>
  
  <p>The lines</p>
  
  <pre><code>private:
  Firstclass a;
  </code></pre>
  
  <p>if what I'd do if a were just a variable instead of a class: mention it first such that I can use it elsewhere (in the function func() for instance). 
  This doesn't seem to work with classes, because the compiler doesn't understand what the constructor of Secondclass is supposed to do. </p>
  
  <p>How do I do this correctly? </p>