c++ cZar

Thursday, October 21, 2010

Overloading < And >

Without friend
int operator > (const Complex& right) const { return (real > right.getReal() && img > right.getImg(); }



Using Friend
friend int operator < (const Complex& left, const Complex& right){----//TODO}
Posted by Rekha Kumari at 11:35 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: friend, operator overloading

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2011 (2)
    • ►  October (1)
    • ►  September (1)
  • ▼  2010 (131)
    • ▼  October (9)
      • Static C strings
      • Friendship isn't inherited, transitive, or reciprocal
      • Should I design my classes from the outside (inter...
      • () vs [] for subscripting in case of more than 1 p...
      • Matrix class is not array of arrays
      • Overloading < And >
      • Operator Overloading in c++
      • Stack in C++
      • Some terms and their synonyms in programming langu...
    • ►  September (40)
    • ►  August (44)
    • ►  July (5)
    • ►  April (28)
    • ►  March (2)
    • ►  February (1)
    • ►  January (2)
  • ►  2009 (125)
    • ►  December (99)
    • ►  November (5)
    • ►  September (8)
    • ►  August (1)
    • ►  June (11)
    • ►  January (1)
  • ►  2008 (25)
    • ►  August (25)

About Me

Rekha Kumari
View my complete profile
Simple theme. Powered by Blogger.