C
Chameleon
The problem:
class Folder inherits from class Entry but class Entry uses pointer to
Folder objects.
This produce:
error: forward declaration of `struct Folder'
error: invalid use of undefined type `struct Folder'|
What I can do?
---------------------------------------------------------
class Entry
{
public:
string getFullPathName() { return parent ? parent->getFullPathName() +
'/' + getName() : getName(); }
string getName() { return name; }
Folder *getParent() { return parent; }
protected:
string name;
Folder *parent;
};
class Folder : public Entry {............}
----------------------------------------------------------
class Folder inherits from class Entry but class Entry uses pointer to
Folder objects.
This produce:
error: forward declaration of `struct Folder'
error: invalid use of undefined type `struct Folder'|
What I can do?
---------------------------------------------------------
class Entry
{
public:
string getFullPathName() { return parent ? parent->getFullPathName() +
'/' + getName() : getName(); }
string getName() { return name; }
Folder *getParent() { return parent; }
protected:
string name;
Folder *parent;
};
class Folder : public Entry {............}
----------------------------------------------------------