You have declared an array of
occurrence
objects called
occurrences
:
struct occurrence occurrences[30];
So all you need is an index to the next free one, and get the address of it using:
struct occurrence *occ = &(occurrences[indexToNextFree++]);
The post increment moves you to the next ready for the next inputsession.