Automatically initialized?
<p>The beginning of my class is:</p>

<pre><code>class Player{
private:
    Cardpile hand;
    ...
}
</code></pre>

<p>Where Cardpile is another class. If I do <code>Player *p=new Player();</code> Is hand automatically initialized? I am asking this because I been trying to figure out a segmentation fault. I have looked everywhere in my code. The last thing I can think of is that <code>hand</code> is not initialized.</p>

<p>EDIT: This is the segmentation error I got. Card is a class inside of Cardpile. I know Card and Cardpile both works.</p>

<pre><code>Program received signal SIGSEGV, Segmentation fault.
0x0000000000402ac0 in __gnu_cxx::new_allocator&lt;Card*&gt;::construct (this=0x6070a8, __p=0x4015c6, __val=@0x7fffffffe6d8) at /usr/include/c++/4.4/ext/new_allocator.h:105
105           { ::new((void *)__p) _Tp(__val); }
</code></pre>

<p>EDIT: Cardpile class:</p>

<pre><code>class Cardpile : private vector&lt;Card*&gt; {
    public:
    using vector&lt;Card*&gt;::size;
    using vector&lt;Card*&gt;::at;
    Cardpile ();
...
}
Cardpile::Cardpile(){}
</code></pre>

<p>EDIT: Here is a cool fact: p==NULL does not check if p is initiated. I guess that's why I keep getting segmentation fault.</p>
