С++ static_cast против динамического_castC++

Программы на C++. Форум разработчиков
Гость
С++ static_cast против динамического_cast

Сообщение Гость »

Код: Выделить всё

#include 

class Base {
};

class Derived : public Base {
};

int main() {
Base* bptr = new Derived();

Derived* dptr = static_cast(bptr);

std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/41619289/c-static-cast-vs-dynamic-cast[/url]

Вернуться в «C++»