I hope I'm missing something really simple here. Can anyone see why this won't compile?
I'm trying to create a dynamic queue of "event"s:
class event {
public:
int event_type;
long time;
event* next_event;
};
but the compiler stumbles when I try to define a function that will take a pointer to an "event" as an argument:
void queue_event(event *new_event_) {
// code to insert a new event into the queue will come here
};
The compiler doesn't seem to recognize the function definition, claiming:
14: error: variable or field 'queue_event' declared void
14: error: 'event' was not declared in this scope
14: error: 'new_event_' was not declared in this scope
Same result exactly if I use a reference instead of a pointer (event& new_event_). If I change the argument to be a pointer to any basic type (e.g. int* new_event_) it compiles without complaint.
Thanks in advance for any help.
Joe