Question
Overload the a) ostream & operator(ostream> Output the human-readable time to the output stream out. b) string to_string(clock_time c) Return the human-readable time as a
Overload the
a)
ostream & operator(ostream>
Output the human-readable time to the output stream out.
b)
string to_string(clock_time c)
Return the human-readable time as a string.
The class clock_time returns hours, minutes and seconds (e.g h=12 ,m=50,s=30).The human-readable representation/string representation of a clock_time object is the time as it would appear on a 24-hour clock. That is, it would appear as h:mm:ss, where h is the natural representation of the hour (not padded), while mm is the minutes past the hour,left padded with zeroes if necessary to ensure it has two digits, and ss is similarly the number of seconds past the minute, left padded with zeroes. Use setw() and setfill() stream manipulators; the to_string function then can be written using an ostringstream obj
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started