8

CHAPTER

Operator Overloadingand Type Conversion

CHAPTEROUTLINE —•  8.1 Introduction
—•  8.2 The Keyword Operator
—•  8.3 Overloading Unary Operators
—•  8.4 Operator Return Type
—•  8.5 Constraint on Increment and Decrement Operators
—•  8.6 Overloading Binary Operators
—•  8.7 Overloading with friend Function
—•  8.8 Type Conversion
—•  8.9 Rules for Overloading Operators
—• 8.10 One Argument Constructor and Operator Function
—• 8.11 Overloading Stream Operators

8.1 INTRODUCTION

Operator overloading is an important and useful feature of C++. The concept of operator overloading is quite similar to that of function overloading.

An operator is a symbol that indicates an operation. It is used to perform operation with ...

Get Object-Oriented Programming with ANSI and Turbo C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.