У нас вы можете посмотреть бесплатно How and when to perform dynamic_cast in c++ | C++ casting | C++ for HFT или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Q: Why and when to use dynamic_cast? Ans: When we have to downcast from the base class pointer to correct the derived class pointer at that time we use dynamic_cast. Our base class pointer holds the object of the targeted derived class object. If we dynamic_cast to the correct derived class, we get the derived class pointer/reference. But if by mistake, we downcast to the wrong derived class, dynamic_cast fails and we get nullptr. To perform the dynamic_cast, there must be at least one virtual function in the base class. The virtual function helps in deciding the correct derived class. NOTE: As dynamic_cast takes place at run time, that's why all the checking takes place at the run time itself. So it decreases the performance of our system this is the reason wherever possible try to avoid dynamic_cast instead of that go with static_cast. dynamic_cast: https://stackoverflow.com/questions/2... To Learn about different casts: https://stackoverflow.com/questions/3... You can connect: Instagram: / lodhi_rajput_karan Linkedin: / karan-lodhi-rajput-b1a44b105 For one-to-one discussion: https://topmate.io/karan_kumar_rajput