Skip to main content

Practice · 2 of 2

Stream output and round-trip

CHALLENGE
Difficulty: intermediate+25 XP

Implement class Version with Version(int maj, int min) and getters, std::ostream& operator<< printing maj.min (e.g. 1.4), and std::istream& operator>> parsing that shape (setting failbit on malformed input).

Back to lesson: Practice: Operator overloading