#include <iostream>
usingnamespace std;
class Shape
{
public:
virtual Shape();
virtualvoid draw() const = 0;
virtualvoid rotate(int) = 0;
private:
short x_, y_;
};
class Circle : public Shape
{
public:
void draw() const;
void rotate(int);
private:
int radius_;
};
void manipulation(Shape* sp)
{
draw(sp);
rotate(sp, 12);
}
enum Type { CIRCLE, SQUARE, TRIANGLE, BLOB };
struct Shape
{
Type type_;
short x_, y_;
};
void draw(Shape*);
void rotate(Shape*, int);
int main()
{
output please;
}
Constructors are never declared virtual. Ever. Your Shape ctor is declared wrong.
This isn't complete code, it shouldn't compile even when you fix the class/struct problem, there are missing function/class method definitions all over.