Friday, 22 June 2012

Related to standard input (cin), how would you implement overloaded operator of extraction (>>) for some custom class?



Input:
3 4

Output:
(1, 2)
(3, 4)

Extraction/insertion operators can be friends of the our custom class in which case they can access its private members directly:


No comments:

Post a Comment