I am trying to create a basic alarm where the user inputs a start time (HHMMSS) and a end time (HHMMSS) and I wish to just display this time in the format (HH:MM:SS) (24 hour time). I am currently at this but I have hit a Segmentation Error. I am fairly new to Coding in C so any help is greatly appreciated.
int main() {
int present_time;
int time_for_alarm;
char outputHolder[30];
printf ("Please input present time\n");
scanf ("%d", &present_time);
printf ("Please input time for alarm\n");
scanf ("%d", &time_for_alarm);
strftime(present_time, sizeof(present_time), "%H:%M:%S", outputHolder);
while (present_time < time_for_alarm) {
sleep(1);
printf ("%d\n", present_time);
present_time++;
}
sleep(1);
printf ("ALARM");
return (0);
}