SegFault after scanf?

scanf requires the addresses of the variables to be passed to it. Replace your scanf by

scanf("%d %d",&hour,&min);

You should be good to go.

Leave a Comment