title: Calling a class inside a class
body: <p>I'm trying to write a class that when asked on, will call on a class and make it into a class member. Here's a quick example of what I mean:</p>
  
  <pre><code>class foo{
    myClass Class;
    foo(); 
  };
  foo::foo()
  {
    //Create the class and set it as the foo::Class variable
  }
  </code></pre>
  
  <p>I'm sure this is actually an easy thing to do. Any help would be appreciated
  Thanks </p>
  
  <p><strong>Edit:</strong> Sorry for the bad terminology. I'll try to go over what I want to do more concisely. I'm creating a class(<em>foo</em>), that has a varaible(<em>Class</em>) with the class definition of (<em>myClass</em>). I need to create a <em>myClass</em> object and assign it to <em>Class</em>, with-in the class <em>foo</em>. Through the help of everyone, I have kind of achieved this. </p>
  
  <p>My problem now is that the object I created gives me a "Unhandled Exception"..."Access violation reading location 0x000000c0" in <em>Class</em>, on the first line of <em>myClass</em>'s function that I'm trying to execute. <em>Thanks for your help!</em></p>
  
  <p><em>note:</em> I'm currently using emg-2's solution.</p>