confusion about parameter name

the code says that I omitted some parameter name, I checked nut couldn't seem to find the problem.

#include <stdio.h>
int main()
{
int secs(int, int, int);
int inhrs, inmins, insecs, total;

printf("Enter a number of hours: ");
scanf("%d",&inhrs);
printf("Enter a number of minutes: ");
scanf("%d",&inmins);
printf("Enter a number of seconds: ");
scanf("%d", &insecs);

total = secs (inhrs, inmins, insecs);

printf("The total number of seconds from function [secs] is %d", total);

return 0;
}

int secs (int, int, int)
{
int totalsecs;
int inhrs, inmins, insecs;

totalsecs = inhrs * 60 * 60 + inmins * 60 + insecs;

return (totalsecs);
}
You need to go back and read up on defining functions.

Your secs function needs to declare the names of its arguments, not just the types:

1
2
3
4
int secs( int hrs, int mins, int secs )
{
  return hrs * 60 * ...etc.
}

Hope this helps.
Topic archived. No new replies allowed.