I have 2 files:
Point.h
:
class Point {
int x;
int y;
char* name;
public:
Point() { name = new char[5]; }
~Point() { delete[] name; }
};
and: Line.h
:
class Point;
class Line {
Point* p;
public:
Line() {
p = new Point[2];
....
...
}
~Line() {
delete[] p;
}
};
but when I compile, I got the next error:
deletion of pointer to incomplete type 'Point'; no destructor called
any help appreciated!
std::string name;
andstd::array<Point, 2>
. Get rid of the icky extra functions you have to take care of when dynamically allocating memory like that. – Fincher#pragma warning (error: 4150)
) – Reyna