You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
367 B
26 lines
367 B
15 years ago
|
#ifndef POLYGON_HPP
|
||
|
#define POLYGON_HPP
|
||
|
|
||
|
class polygon
|
||
|
{
|
||
|
protected:
|
||
|
double side_length_;
|
||
|
|
||
|
public:
|
||
|
polygon() : side_length_(0)
|
||
|
{}
|
||
|
|
||
|
void set_side_length(double side_length)
|
||
|
{
|
||
|
side_length_ = side_length;
|
||
|
}
|
||
|
|
||
|
virtual double area() const = 0;
|
||
|
};
|
||
|
|
||
|
// the types of the class factories
|
||
|
typedef polygon* create_t();
|
||
|
typedef void destroy_t(polygon*);
|
||
|
|
||
|
#endif
|