I have a little stupid question, hope some will help
okay, let's say like this. I have a template class, eg. class Human, therefore it can not be modified.
Ok, now I write a class, eg. class Female, inherit from class Human.
Now the problem is, if i have a function return a Human value, and I want to assign the value to Female, this is typically impossible.
For example, like this
And if I have a code like thisCode:class Human { public Human getHuman() { return aDummyHuman; } } class Female : Human{ private Item handBag; }
Probably I will get an error likeCode:objFemale1 = functionReturnHumanValue("Blah Blah Blah");
error C2440: '=' : cannot convert from 'Human' to 'Female'
So what should I do in this stage, to get objFemale1 get all the value of Human properties, plus for handBag, eg. = NULL?
Thanks in advance