Рассмотрите следующий код:
Код: Выделить всё
#include
struct Node
{
virtual void print()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/53106645/polymorphism-with-a-dereferenced-pointer-yields-unexpected-results-why[/url]
Код: Выделить всё
#include
struct Node
{
virtual void print()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/53106645/polymorphism-with-a-dereferenced-pointer-yields-unexpected-results-why[/url]