| In the definition of class time, you have a data member (in the private or protected section, I assume) called hours, right? If you don't, you should (and it should be of type int, if I understand rightly what you're trying to do).
As to the syntax error: which statement exactly is giving it? Are you trying to use the prototype statement to invoke the method? If so, you're doing it wrong; unless declared static, a method must be invoked relative to an object, i.e., if t is an object of type time, call setHours thus: t.setHours(foo);
I must go to class shortly...see if you can recruit other help. |