Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- HandPhone A,B;
- A>>B;//overloading operator>> to simulate sending sms to another handphone(object)
- return 0;
- }
- void operator >> (HandPhone& a, HandPhone& b)
- {
- // Add code here.
- }
- B.sendMessageTo(A,Message("PLOP"));
- class A;
- class B;
- A operator << (A& a, const B& b) // a << b; sends b to a.
- {
- a.sendMessage(b);
- return a;
- }
Add Comment
Please, Sign In to add comment