Skip to main content

Practice ยท 2 of 2

Stream output and round-trip

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).

Difficulty: intermediate

Back to lesson: Practice: Operator overloading