As mentioned in other answers, you need to provide a constructor:
struct Event {
enum EventKind {Arrival, Departure};
EventKind type;
int time, length;
Event(EventKind theType=Arrival, int theTime=0, int theLength=0);
};
Event::Event(EventKind theType, int theTime, int theLength):
type(theType),
time(theTime),
length(theLength)
{}
It is also possible to inline the definition inside the declaration of your structure:
struct Event {
enum EventKind {Arrival, Departure};
EventKind type;
int time, length;
Event(EventKind theType=Arrival, int theTime=0, int theLength=0):
type(theType),
time(theTime),
length(theLength)
{}
};
In fact, in C++, it is possible to think about structures like classes whose members are public by default. Hence, the way to define a constructor is the same for structures and classes.