Re: [inti] entry fun

Jeff Franks <[email protected]> Mon, 05 Jan 2004 19:37:46 +1100
Newsgroups gmane.comp.gnome.inti
Message-ID <[email protected]>
Bo Lorentsen wrote:

> Gtk::Entry *entry = new Gtk::Entry();
>
>> Gtk::Editable *editable = dynamic_cast<Gtk::Editable*>(entry);
>
>
> Dynamic cast are only needed when downcasting, right ?
>
As far as I'm aware, dynamic casting is always required when 
upcasting/downcasting if multiple inheritance is used. This is because 
with multiple inheritance objects have several addresses. Using a 
dynamic cast ensures that pointer returned actually does point to the 
beginning of the multiplely inherited base object's memory.

Jeff Franks.


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click