title: Passing parameters to the constructor of a class which is a member of another class
body: <p>I have class called Bar,
  and in this class Bar there is an object of type Foo (a class).
  Class Bar takes 3 parameters, x, y and z. Foo takes 2 parameters, y and z.</p>
  
  <p>currently I'm doing this:</p>
  
  <pre><code>class Bar {
   public:
    Bar(int x, int y, int z) { 
        foo = new Foo(y, z);
        do something with x;
    }
  
   private:
    Foo * foo;
  };
  </code></pre>
  
  <p>I remember seeing in a book another way to do this using a colon but I don't remember how exactly. </p>
  
  <p>What is the standard or usual way of doing something like this?</p>