Sementation fault 11 in simple SWITCH
<pre><code>int main(){
MyBase *mb;
int choice;

cout &lt;&lt; "Select: ";
cin &gt;&gt; choice;

switch (choice) {
    case 1:
        mb = new Test1();
        break;
    case 2:
        mb = new Test2();
        break;
    case 3:
        mb = new Test3();
        break;
    case 4:
        mb = new Test4();
        break;
    case 5:
        mb = new Test5();
        break;
    case 6:{
        LinkTest t;
        t.start();
        break;
    }
    default:
        return 0;
}

if(mb != 0){
    mb-&gt;start();
    delete mb;     
}

return 0;
}
</code></pre>

<p>If choice is 6, why am I getting a segmentation fault when checking if mb is NULL?</p>

<p>I am new to c++ and just doing some exercises. 
How can I fix this without affecting the class LinkTest?
Thanks.</p>
