Strange Compiler error at the beginning of header

I am using a header file to declare a class for a queue, which is just a dynamic array and the functions to insert and remove as well as grow the array. The problem is that the compiler gives me this error:

queue.h:7: error: expected ‘,’ or ‘...’ before ‘class’
queue.h:9: error: expected `)' before ‘;’ token


The header is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __QUEUE_H__
#define __QUEUE_H__

#include <iostream>
#include "p1.h"

class emptyQueue {
    // OVERVIEW: an exception class
};

class Queue {
    // OVERVIEW: contains a dynamic array of spaces.

 public:

    // Operational methods

    bool isEmpty();
    // EFFECTS: returns true if list is empy, false otherwise

    void insert(space *o);
    // MODIFIES this
    // EFFECTS inserts o at the front of the list

    space *remove();
    // MODIFIES this
    // EFFECTS removes and returns first object from non-empty list
    //         throws an instance of emptyList if empty

    // Maintenance methods
    Queue();                                   // ctor
    ~Queue();                                  // dtor

 private:
    // A private type
    int numElts;
    int maxElts;
    space** queue;

    // Utility methods

    //Increases the size of the queue.
    void makeLarger();
    
};


#endif /* __QUEUE_H__ */ 


I just can't imagine what I need to change before my exception class.
The error is in pi.h
haha, there was an error in p1.h. Thanks! I've never run into errors spilling over into other files before :/
Also, please inherit your exceptions from std::exception at least (hopefully from one of the more derived versions).
yeah, I'll do that. This is a just a template that I was using from one of my previous classes, so it's far from perfect. Doesn't even have a copy ctor or assignment operator.
Topic archived. No new replies allowed.