struct event {
char *month;
int day;
};
/* Set the month and day of an event struct given a string in the format
* "MonthName DayNumber"
*
* For example, if arg is "December 25", the event’s month should be set to "December",
* and its day should be set to 25.
*/
void set_struct(struct event *e, char *arg) {
char *tmp = strchr(arg, ’ ’);
e->date = strtol(tmp + 1, NULL, 10);
int size = strlen(arg) - strlen(tmp) + 1;
e->month = malloc(sizeof(char) * size);
strncpy(e->month, arg, size - 1);
e->month[size] = ’\0’;
}