S
sandy
I am a student who is losing his mind.
The code below is a header file which has the line:
void ClearList(ListType *list);
which generates the following compile time errors:
variable or field `ClearList' declared void
expected `;' before '(' token
The first error makes no sense to me since it is OBVIOUS I set it to
return void (nothing). The second seems to imply that one of the lines
above is missing a ;
If I comment out the 'void ClearList...' the ; error goes away and it
will compile. This indicates that I am NOT missing a ; before the
declaration.
Can anyone wiser than me see the problem?? I have been looking at that
one line for an hour.
<code>
class JobCollection
{
public:
/******************************************************
Constructor
Inputs:
Outputs:
Notes: Creates a new empty linked list with no nodes.
************************************************************/
JobCollection();
/******************************************************************************
ClearList
Inputs: Pointer to a list
Outputs: None
Notes: Empties the list of all nodes.
*******************************************************************************/
void ClearList(ListType *list);
typedef Job ListEntry;
typedef struct list_node_def
{
ListEntry data;
struct list_node_def *next;
}ListNode;
typedef struct listtype
{
int count;
ListNode *head;
}ListType;
private:
/******************************************************************************
CreateList
Inputs:
Outputs: None
Notes: Creates an empty linked list with no nodes
******************************************************************************/
void CreateList(ListType *list);
};
</code>
The code below is a header file which has the line:
void ClearList(ListType *list);
which generates the following compile time errors:
variable or field `ClearList' declared void
expected `;' before '(' token
The first error makes no sense to me since it is OBVIOUS I set it to
return void (nothing). The second seems to imply that one of the lines
above is missing a ;
If I comment out the 'void ClearList...' the ; error goes away and it
will compile. This indicates that I am NOT missing a ; before the
declaration.
Can anyone wiser than me see the problem?? I have been looking at that
one line for an hour.
<code>
class JobCollection
{
public:
/******************************************************
Constructor
Inputs:
Outputs:
Notes: Creates a new empty linked list with no nodes.
************************************************************/
JobCollection();
/******************************************************************************
ClearList
Inputs: Pointer to a list
Outputs: None
Notes: Empties the list of all nodes.
*******************************************************************************/
void ClearList(ListType *list);
typedef Job ListEntry;
typedef struct list_node_def
{
ListEntry data;
struct list_node_def *next;
}ListNode;
typedef struct listtype
{
int count;
ListNode *head;
}ListType;
private:
/******************************************************************************
CreateList
Inputs:
Outputs: None
Notes: Creates an empty linked list with no nodes
******************************************************************************/
void CreateList(ListType *list);
};
</code>