{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

topic09_OperatorOverloading

topic09_OperatorOverloading - Operator Overloading in C CS...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Operator Overloading in C++ CS 1037a Topic 9
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Some standard operators some operators are defined for all basic types like int , float , char ,… (some are defined for pointers too) - operator+ , operator- , operator+= , operator* , operator/ - operator= ( copy or assignment operator) - operator== , operator!= - operator< , operator> , operator<= standard operator [ ] is defined for pointers only - if p is a pointer, p[i] returns *(p+i) (more in Topic 2) 9-2 C++ allows to define/ overload operators for objects of any class !
Background image of page 2