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:
class foo{
myClass Class;
foo();
};
foo::foo()
{
//Create the class and set it as the foo::Class variable
}
I'm sure this is actually an easy thing to do. Any help would be appreciated Thanks
Edit: Sorry for the bad terminology. I'll try to go over what I want to do more concisely. I'm creating a class(foo), that has a varaible(Class) with the class definition of (myClass). I need to create a myClass object and assign it to Class, with-in the class foo. Through the help of everyone, I have kind of achieved this.
My problem now is that the object I created gives me a "Unhandled Exception"..."Access violation reading location 0x000000c0" in Class, on the first line of myClass's function that I'm trying to execute. Thanks for your help!
note: I'm currently using emg-2's solution.