Allora potresti stravolgere il codice così:
codice:
printf("Enter day and reminder: ");
scanf("%2d", &day);
if (day > 1 || day <= 31)
{
sprintf(day_str, "%2d", day);
read_line(msg_str, MSG_LEN);
for (i = 0; i < num_remind; i++)
if (strcmp(day_str, reminders[i]) < 0)
break;
for (j = num_remind; j > i; j--)
strcpy(reminders[j], reminders[j-1]);
strcpy(reminders[i], day_str);
strcat(reminders[i], msg_str);
num_remind++;
}
else printf("Errore\n");
}
Controlla te le parentesi, ho fatto solo per farti capire..
Ciao