struct customtype
{
int someint;
float somefloat;
}
class Parent
{
public:
customtype ParentWidget
};
class Child : public Parent
{
public:
customtype ChildWidget
};
the problem i'm having is this:
vector<Child> ChildObject(5); // anybody know how to do an angle bracket without using the source tag? :)
ChildObject[1].ChildWidget.someint = 1234; // this is okay
ChildObject[1].ChildWidget.somefloat = 1.2345; // this is also okay
ChildObject[1].ParentWidget.someint = 1234; // this is not okay.. i get a compiler error saying ParentWidget is undefined.
is this supposed to happen? could it be that i haven't initialized
my ParentWidget through a constructor?
templates are supposed to encourage reusability, as is inheritance..
so my obvious thought is that they should work together naturally...
i hope im just doing something terribly stupid here..
[edit: damn html codes]
-eldee
;another space monkey;
[ Forced Evolution Studios ]
[edited by - eldee on September 8, 2002 2:58:05 PM] [edited by - eldee on September 8, 2002 2:58:44 PM]