How can I add a class member if the other class' constructor requires arguments?
<p>I'm not coding much in C++, so please forgive me if this is trivial.</p>

<p>My class "Foo" looks somewhat like this:</p>

<pre><code>class Foo {
    public: Foo(int n) { }
};
</code></pre>

<p>Another class "Bar" is now supposed to have a class member of type "Foo".</p>

<pre><code>class Bar {
    private: Foo f;
};
</code></pre>

<p>This obviously fails, because there is no constructor for "Foo" that does not require any arguments. However, stuff like <code>Foo f(1);</code> fails, too.</p>

<p>Is there any way to solve this problem? Or am I supposed to use a pointer here?</p>
