| | |
converting base class to dervived class
![]() |
>Can someone please explain to me why converting a base class pointer to a
>derived class pointer is considered dangerous by the compiler.
It's not "dangerous" as you say, but it does go against the rules of implicit conversions, so conversion without a cast is illegal, and most of the time such a conversion represents a design flaw, so downcasting is discouraged.
>derived class pointer is considered dangerous by the compiler.
It's not "dangerous" as you say, but it does go against the rules of implicit conversions, so conversion without a cast is illegal, and most of the time such a conversion represents a design flaw, so downcasting is discouraged.
I'm here to prove you wrong.
![]() |
Similar Threads
Other Threads in the C Forum
- Previous Thread: binary search
- Next Thread: What is Telecommunication Domain!
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches initialization intmain() iso km license linked linkedlist linux linuxsegmentationfault list logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






