Here`s a simple program to convert time into seconds. For ex. 23:00:59-->82859.
The problem is that the scanf always ask for a 4th value, which is not used in the conversion. Why? I`m using gcc.
int convert(int hora, int minuto, int segundo){
int i;
i = hora*3600 + minuto*60 + segundo;
return i;
}
int main(void){
int h,m,s;
scanf("%d\n", &h);
scanf("%d\n", &m);
scanf("%d\n", &s);
printf("%d\n",convert(h,m,s));
return 0;
}