-
March 8th, 2010, 11:31 AM
#1
Reason for upcast and downcast
Helo guys,
can anyone clarify me like what is the need for doing downcast and upcast ?
Thanks in advance
-
March 8th, 2010, 11:55 AM
#2
Re: Reason for upcast and downcast
You should never need to explicitly upcast. The assignment should just work. (Be careful of slicing, though.)
Normally you should avoid downcasting, but on some occasions it's useful if you know the specific type of a particular object through other means and you need to access functionality particular to that type.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|