我有 2 个文件:
Point.h
:
class Point {
int x;
int y;
char* name;
public:
Point() { name = new char[5]; }
~Point() { delete[] name; }
};
和Line.h
:
class Point;
class Line {
Point* p;
public:
Line() {
p = new Point[2];
....
...
}
~Line() {
delete[] p;
}
};
但是当我编译时,我得到了下一个错误:
deletion of pointer to incomplete type 'Point'; no destructor called
任何帮助表示赞赏!