HI guys,
This code dosn't compile, I think it is right but it gives an error when i use the -> to access the members of my struct.
#include <stdio.h>
#include <stddef.h>
#define MAX_EVENTS 100
//Structure for Queue Elements
struct Event
{
int event_type;
int time_value;
int bus_num;
int bus_stop;
};
void main()
{
Event *eventPtr;
// EventPtr event_queue;
eventPtr = new Event[MAX_EVENTS];
event_queue[0]->event_type = 1;
event_queue[0]->time_value = 2;
event_queue[0]->bus_num = 0;
event_queue[0]->bus_stop = 1;
}
It works when i create it without using the "new" operator. But this way it dosn't. WHat's going on here? I'm using the Visual C++ 6.0 compiler.
thanks..