|
-
May 18th, 1999, 09:47 AM
#1
What is <dynamic_cast>
The <dyanmic_cast> and <static_cast> are MACROS rite??
I want the listing of this...
Or else i want its functionality....I want that how it actually type casts the thing.....
Please help me...
Thanks
Anand
-
May 18th, 1999, 10:20 AM
#2
Re: What is <dynamic_cast>
dynamic_cast & static_cast are operators, not macros.
static_cast & dynamic_cast simply cast the desired object to the desired type. dynamic_cast, however, is able to perform some runtime checking and will return NULL if the desired object cannot be cast to the desire type--static_cast will always cast it, regardless of whether or not it makes sense (this could be dangerous). Because the static_cast does not do type checking, it is more dangerous to use, but it is also faster. So if you know what you are casting is okay, then use static_cast.
--michael
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
|