In your function void display(Time t) your if statements need to have braces and you should include an else statement after each if statement that displays hour/minutes/seconds without the leading zero to handle double digit numbers.
Then just add code to convert diff into hours, minutes, and seconds so you can display it formatted correctly and then in main, do something like
i had to use else if's in order for the brackets to work and i don't understand why display(Time t); doesn't work since its the same name as the void? Mind you I have only done two other assignments with calling.
Oh I see what's wrong. You have to pass in the time you want to display in your display function, not Time t. Sorry, I should have been more specific earlier. For this code it would look like this
yes, that got it to work. I had to put the else ifs back to ifs in order for it display correctly. However after i run it and close it. I try to run it again and it just gives me a black screen.
Process returned 0 (0x0) execution time : 0.016 s
Press any key to continue.
it asks for me to enter in again which is ok because of the loop and i need it to for my assignment. but when close out of it and try to run again i get that message.. it went away and came back again.. so frustrating i cant check my code ahhhhhhhhhh
I don't know about it not working after closing it, I feel like your while loop might have something to do with that, I couldn't even run it as it was, I had to make it a do while loop because Time1 was uninitialized.
That's not how you call findDiff, this is cout<<"Diff =" << findDiff(Time1, Time2); , but it returns the time in seconds so you would need to convert it to hours, minutes, and seconds to get it to display how you wanted it.
Thanks for all the help pnoid I greatly appreciate it. I just have to find out how to convert seconds int hours min seconds now. I think i know how its just figuring out how to write it at this point.
many thanks. if there is a way for me to thumbs up you let me know