child and parent class args
From: David Sobey (dsobey_at_NOSPAMugrad.unimelb.edu.au)
Date: 03/31/05
- Next message: ganesh_tiwari_at_hotmail.com: "Translate C++ to C"
- Previous message: Mr.Bolshoy Huy: "Re: Off TopicTroll: OOP is bad?"
- Next in thread: Peter MacMillan: "Re: child and parent class args"
- Reply: Peter MacMillan: "Re: child and parent class args"
- Reply: Rolf Magnus: "Re: child and parent class args"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: ganesh_tiwari_at_hotmail.com: "Translate C++ to C"
- Previous message: Mr.Bolshoy Huy: "Re: Off TopicTroll: OOP is bad?"
- Next in thread: Peter MacMillan: "Re: child and parent class args"
- Reply: Peter MacMillan: "Re: child and parent class args"
- Reply: Rolf Magnus: "Re: child and parent class args"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]