Recently I was assigned a program for class and I've been having some problems. At my old school, the teacher worded the instructions differently, so I am not entirely sure how to translate the following lines of instruction into the proper setup for my structs, arrays, and shorts.
Instructions:
1. Typedef struct Day contains a short named "day", a short named "month", an array named "appts" of eight pointers to typedef struct Appointment, and a short named "apptCount".
2. Typedef struct Appointment contains: "startTime" and "endTime" of typedef struct Time, a dynamically allocated array of char named "subject", and a dynamically allocated array of char named "location".
3. Typedef struct Time uses contains a short named "hour" (0 – 23), a short named "minute".
I have come up with the following, but I feel like I'm doing it wrong as it seems like the structs are more intertwined than this:
typedef struct Appointment
{
char subject[], location[];
int appts[8];
}; // End struct Appointment
typedef struct Day
{
short day, month, apptCount;
int days[];
}; //End struct Day
typedef struct Time
{
string startTime, endTime;
short hour, minute;
}; //End struct Time
Any direction is greatly appreciated.