QUOTE(wizzy89 @ 24 Jan, 2008 - 02:48 PM)

hello,
from this program instead of this:
CODE
int setTime(Mytime& t, int h, int m )
{
t.hours = h;
t.mins = m;
return 0;
}
how can the function be written with the following comments instead of using stubs:
CODE
int setTime( Mytime& t, int h, int m );
// if valid time sets hh and mm to h and m
// and returns 0
// if invalid returns integer > 0 as error code
// error code +1 = underflow hours
// error code +2 = overflow hours
// error code +4 = underflow mins
// error code +8 = overflow mins
Thanks
Hi i am coding this program also check out 'Error checking time code program' posted today. It won't be much help as mine isn't completely correct either but you are welcome to use it if it helps at all.
I have got it to print out an error code if the data input is invalid however i can only get it to do it for the input 'hours' when i add the mins
in an invalid form it ignores them. You are not in a 'Bailey' class by any chance are you???
people don't seem to be coming forward with this problem do they? anyone there??
This post has been edited by Tara200: 27 Jan, 2008 - 02:46 PM