child and parent class args

From: David Sobey (dsobey_at_NOSPAMugrad.unimelb.edu.au)
Date: 03/31/05


Date: Wed, 30 Mar 2005 14:52:30 -0800

hi

Here's some code:

void SomeFunc(childClass arg);
...

parentClass a;
a=new childClass();
SomeFunc(a);

this spits out an error, it can't convert an object of type parentClass to
childClass. Doesn't work for pointers either. Can anyone shed some light on
how to get this working without casting? In the long run I'll have lots of
childClasses and casting each will become a nightmare.

Cheers
dave