- 1 Eki 2019
- 27
- 0
#include<iostream>
using namespace std;
class Shape;
class DispWindow;
class Point;
class Rectangle;
class Shape
{
public:
Shape();
~Shape();
virtual **** draw(DispWindow& w)=0 ;//kesinlikle böyle olucak
};
class DispWindowublic Shape
{
public:
DispWindow(int, int);
DispWindow(const DispWindow&);
DispWindow(Rectangle&);
~DispWindow();
Point current();
**** show();
**** draw(DispWindow&);
private:
int row, column;
char** p;
};
class Rectangleublic Shape
{
public:
Rectangle(Point&, Point&);
Rectangle(const Rectangle&);
**** setleftcorner(Point);
**** setrigtcorner(Point);
Point getleftcorner();
Point getrightcorner();
private:
Point *leftcorner;
Point *rightcorner;
};
class Point
{
public:
Point();
Point(int,int);
int getx()const;
int gety()const;
**** setx(int);
**** sety(int);
Point right(int);
Point down(int);
private:
int x;
int y;
};
**** drawRectangles()
{
DispWindow Wind(50, 50);
for (int i = 0; i < 10; i++)
Wind.draw(Rectangle(Wind.current(), Wind.current().right(10).down(10)));
Wind.show();
}
int main()
{
//drawDots();
// uncomment the following lines in order to test your program
drawRectangles();
// drawLines();
// drawHome();
}
yazdığım bu kodda visual studioda c2440 ve c2064 c2259 hatası veriyor.
Bu hatayı nasıl çözebilirim.
using namespace std;
class Shape;
class DispWindow;
class Point;
class Rectangle;
class Shape
{
public:
Shape();
~Shape();
virtual **** draw(DispWindow& w)=0 ;//kesinlikle böyle olucak
};
class DispWindowublic Shape
{
public:
DispWindow(int, int);
DispWindow(const DispWindow&);
DispWindow(Rectangle&);
~DispWindow();
Point current();
**** show();
**** draw(DispWindow&);
private:
int row, column;
char** p;
};
class Rectangleublic Shape
{
public:
Rectangle(Point&, Point&);
Rectangle(const Rectangle&);
**** setleftcorner(Point);
**** setrigtcorner(Point);
Point getleftcorner();
Point getrightcorner();
private:
Point *leftcorner;
Point *rightcorner;
};
class Point
{
public:
Point();
Point(int,int);
int getx()const;
int gety()const;
**** setx(int);
**** sety(int);
Point right(int);
Point down(int);
private:
int x;
int y;
};
**** drawRectangles()
{
DispWindow Wind(50, 50);
for (int i = 0; i < 10; i++)
Wind.draw(Rectangle(Wind.current(), Wind.current().right(10).down(10)));
Wind.show();
}
int main()
{
//drawDots();
// uncomment the following lines in order to test your program
drawRectangles();
// drawLines();
// drawHome();
}
yazdığım bu kodda visual studioda c2440 ve c2064 c2259 hatası veriyor.
Bu hatayı nasıl çözebilirim.