1// money.h -- define the prototype
2class Money
3{
4 public:
5 Money & operator += (const Money &rhs);
6}
7
8// money.cpp -- define the implementation
9Money& Money :: operator += (const Money &rhs)
10{
11 // Yadda Yadda
12
13 return *this;
14}
1struct Foo
2{
3 double val;
4 friend bool operator<(const Foo& l, const Foo& r)
5 {
6 //Custom comparison for l < r goes here
7 return l.val < r.val;
8 }
9};
1istream& operator>>(istream& is, node*& head)
2{
3 // Function call to overload the ">>"
4 // operator
5 takeInput(head);
6}
7
1ostream& operator<<(ostream& os, node* head)
2{
3 // Function call to overload the "<<"
4 // operator
5 print(head);
6}
7