Hello,
I keep getting the following error when ever I try to create a pointer to a linked list from another class:
C++ forbids declaration of 'ContentsOfFile' with no type
How do I create a pointer to a linked list, from another class?
For example, this is what I tried but it did not work:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Files
{
public:
ContentsOfFile *Contents; // pointer to linked list where
// contents of file can be found (??)
Files();
Files *next;
};
// Linked list where contents of file is stored
class ContentsOfFile
{
public:
string fileContents;
};