View Single Post
Old 07-10-2005, 04:02 PM   #6 (permalink)
ben657
Registered User
 
Join Date: Jul 2005
Posts: 4
ben657 is on a distinguished road
OK, I have got to a point where I can have an instance of a class in the .cpp file for a unit, but not in the header! For example this is fine:

Code:
// ------------------------------
// CEntity.h

#include "CList.h"

class CEntity
{
        void func ();
};

// ------------------------------
// CEntity.cpp

#include "CEntity.h"

void CEntity :: func ()
{
        CList *List;         
}

// ------------------------------
This gives an error:

Code:
// ------------------------------
// CEntity.h

#include "CList.h"

class CEntity
{
        void func ();
};

void CEntity :: func ()
{
        CList *List;         
}

// ------------------------------
The problem is that I have some members of the class that are CList type, so they have to go somewhere in the header.
ben657 is offline   Reply With Quote