hi guys,
i have this program but it wont compile on DEV C++, it compiles on Borland actually, my compiler say:
[linker error] undefine reference hms (long, long*,long*,long)
ld return 1 exit status
can someone tell me what is this all about?
heres my code:
#include <stdio.h>
#include<math.h>
void hms(long int, long int*, long int*, long int*);
int main()
{
long int time;
long int hr, mn, sc;
time = hr = mn = sc = 0;
printf("Enter the total number of seconds: ");
scanf("%ld", &time);
hms(time, &hr, &mn, &sc);
printf("\n%ld seconds are %ld hours, %d minutes and %ld seconds",time, hr, mn, sc);
return 0;
}
void hms(long int time, int *hr, long int *mn, long int *sc)
{
*hr = time / 3600;
*mn = (time - (*hr * 3600)) / 60;
*sc = (time - (*hr * 3600) - (*mn * 60));
}