mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 22:02:49 -06:00
35 lines
521 B
C++
35 lines
521 B
C++
#include <CtrlLib/CtrlLib.h>
|
|
using namespace Upp;
|
|
|
|
struct Shape
|
|
{
|
|
virtual void Description() {}
|
|
virtual ~Shape() {}
|
|
};
|
|
|
|
struct Line : public Shape
|
|
{
|
|
void Description()
|
|
{
|
|
Cout()<<"Line\n";
|
|
}
|
|
};
|
|
|
|
struct Pict : public Shape
|
|
{
|
|
Image img;
|
|
Pict(Image image): img(image){}
|
|
void Description()
|
|
{
|
|
Cout()<<"Picture\n";
|
|
}
|
|
};
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
Array <Shape> array;
|
|
array.Add(new Line());
|
|
array.Add(new Pict(Image::Arrow()));
|
|
array[0].Description();
|
|
array[1].Description();
|
|
}
|