This is my code...
The user can change and put their information on.
char* APPOINTMENTS[][7] =
{{"Bob", "Beach", 24, 9, 2018, 21, 30},
{ "Bob", "Work", 24, 9, 2018, 22, 25},
{ "Bob", "Soccer", 24, 9, 2018, 20, 30},
{ "Bob", "Homework", 24, 9, 2018, 23, 15},
{ "Bob", "Movie", 24, 9, 2018, 10, 45}};
//(USERNAME, APPOINTMENT, DAY, MONTH, YEAR, HOUR, MINUTE)
But I'm having trouble working out the next part ...
Obviously the schedules are not in order from the closest to the farthest.
I need help to create a function that organizes and displays the informations and schedule in order, in a lcd, one at a time.
for (int id = 0; id < TOTAL_APPOINTMENTS; id++) {
if(APPOINTMENTS[id][0] == USER)
{
if(APPOINTMENTS[id][2] == dt.day && APPOINTMENTS[id][3] == dt.month && APPOINTMENTS[id][4] == dt.year)
{
if(APPOINTMENTS[id][5] == dt.hour) // same hour
{
if(APPOINTMENTS[id][6] < dt.minute) // the appointment is gone
{ }
else // the appointment isn't gone
{
appointments_today++;
}
}
else if(APPOINTMENTS[id][5] > dt.hour)
{
appointments_today++;
}
}
}
}
I stopped here ...
I need some light.