---
title: "Overloadable operators in C++"
subject: "Object Oriented Programming"
chapter: 5
key: "semester_3/object_oriented_programming:overloadable-operators"
source: https://www.bctengineer.com/q/semester_3/object_oriented_programming/overloadable-operators
site: BCT Engineering
---

# Overloadable operators in C++

Object Oriented Programming · Chapter 5: Operator Overloading

- Asked in: 2068 Baisakh, 2 marks
- Video: [Operator Overloading in C++](https://www.youtube.com/watch?v=InIOEY0HXCE) — ReelLearning
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/object_oriented_programming/overloadable-operators
- Whole chapter: https://www.bctengineer.com/md/semester_3/object_oriented_programming/chapter-5

## Question

What are the overloadable operators in C++?

## Short answer

Most operators can be overloaded: arithmetic (+, -, *, /, %), unary (++, --, !, -), relational (==, <, >, <=, >=, !=), logical (&&, ||, !), bitwise (&, |, ^, ~, <<, >>), assignment (=, +=, etc.), subscript ([]), function call (()), member access (->, ->*), comma, address-of, and memory (new, delete). Not overloadable: :: . .* ?: sizeof typeid.

## Answer

C++ allows most of its operators to be overloaded for user-defined types.

| Category | Operators |
|---|---|
| Arithmetic | `+  -  *  /  %` |
| Unary | `+  -  ++  --  !  ~` |
| Relational | `==  !=  <  >  <=  >=` |
| Logical | `&&  \|\|  !` |
| Bitwise | `&  \|  ^  ~  <<  >>` |
| Assignment | `=  +=  -=  *=  /=  %=  &=  \|=  ^=  <<=  >>=` |
| Subscript, call, pointer | `[]  ()  ->  ->*` |
| Address, comma | `&  ,` |
| Memory | `new  delete  new[]  delete[]` |

Notes:
- `=`, `[]`, `()` and `->` must be overloaded as member functions.
- Operators like `<<` and `>>` for streams are overloaded as non-member (friend) functions.
- Operators `::  .  .*  ?:  sizeof  typeid` cannot be overloaded.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which must be member functions?
   A. + and -
   B. =, [], () and ->
   C. << and >>
   D. && and ||
   Answer: B. These four must be members. (Key point: Member only)

2. How are << and >> for streams overloaded?
   A. Non-member (friend)
   B. Member of ostream by user
   C. Static
   D. Cannot
   Answer: A. They are non-member (friend) functions. (Key point: Stream operators)

3. Which of these can be overloaded?
   A. new and delete
   B. sizeof
   C. ::
   D. ?:
   Answer: A. new, delete, new[] and delete[] are overloadable. (Key point: Memory operators)

## Related in Object Oriented Programming

- [Operators that cannot be overloaded](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Anon-overloadable-operators) — Object Oriented Programming, chapter 5, asked 2×
