-
Prob with typedef
Hi all,
I wrote this function which takes a struct type Time and returns the total number of seconds. anyway, the part that I am having a problem with is this one:
int functime(Time parm)
{
t_n_s = ((3600 * Time.hours) + (Time.minutes) + Time.seconds);
return t_n_s;
}
I get an error saying that "Time was declared as typedef and cannot occur as an expression".
Can someone tell me what I am doing wrong.Any help will be greatly appreciated.
Thanks
Janis
-
t_n_s = ((3600 * Time.hours) + (Time.minutes) + Time.seconds);
should be
t_n_s = ((3600 * parm.hours) + (parm.minutes) + (parm.seconds);
Time is the type of the variable, parm is the identifier which is used in expressions.
-Prelude
-
-
another problem
Now awhen I compile it I get:
ld:
Unresolved:
main
What does it mean?
Thanks
-
It means you have not written the function main() at all in your program. Remember, in a C Program, the first function to be called is this one.