To be able to use operator overloading in C++.
For this lab, you will work with a program that creates a Time class. This
class stores an hours and minutes field and has functions for printing the
time, and testing if a time is before another. You will change this class to
use operator overloads for these instead of named functions.
- Download time.cpp file.
- Compile and run it to see how it works.
- Change the "print" function into an overload << operator.
- Change the "before" function into an overload < operator.
- Modify the main function so that it uses operators instead of functions.
- I'd recommend doing these changes one by one.
When your program works, email the code to email@example.com.
Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.