---
title: "Binary operator member function one argument"
subject: "Object Oriented Programming"
chapter: 5
key: "semester_3/object_oriented_programming:binary-member-one-argument"
source: https://www.bctengineer.com/q/semester_3/object_oriented_programming/binary-member-one-argument
site: BCT Engineering
---

# Binary operator member function one argument

Object Oriented Programming · Chapter 5: Operator Overloading

- Asked in: 2068 Chaitra, 2 marks
- Video: [4.10 Overloading Binary Operator in C++](https://www.youtube.com/watch?v=9ynCoYTxjSw) — Darshan University
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/object_oriented_programming/binary-member-one-argument
- Whole chapter: https://www.bctengineer.com/md/semester_3/object_oriented_programming/chapter-5

## Question

Why does the overloading of a binary operator with a member function require only one argument?

## Short answer

With a member function, the left operand is the calling object (passed implicitly via this pointer), so only the right operand is required as an explicit parameter. a+b becomes a.operator+(b).

## Answer

A binary operator has two operands, for example `a + b`. When it is overloaded as a **member function**, the left operand is the object that calls the function, and it is passed implicitly through the `this` pointer. So only the right operand needs to be passed explicitly as an argument.

```cpp
class Complex {
    float re, im;
public:
    Complex operator+(Complex b) {       // one argument: right operand
        Complex r;
        r.re = re + b.re;                // re  is this->re  (left operand a)
        r.im = im + b.im;
        return r;
    }
};
// c = a + b;   is interpreted as   c = a.operator+(b);
```

Here `a` is the invoking object (available as `this`), and `b` is the only explicit argument. In contrast, a friend (non-member) function has no `this` pointer, so it needs two arguments for a binary operator.

## Check yourself

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

1. In a member binary operator, how does the left operand get passed?
   A. Implicitly through this
   B. As first argument
   C. Through global
   D. As static
   Answer: A. The invoking object is the left operand via this. (Key point: Left operand)

2. c = a + b; is interpreted as?
   A. c = a.operator+(b)
   B. c = b.operator+(a)
   C. c = operator+(a)
   D. c = a.operator+()
   Answer: A. a is invoking object, b the argument. (Key point: Interpretation)

3. Why does a friend binary operator need two arguments?
   A. No this pointer
   B. It is private
   C. It is static
   D. It is const
   Answer: A. A friend has no this pointer, so both operands are explicit. (Key point: Friend contrast)

## Related in Object Oriented Programming

- [Binary and unary operator overloading](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Abinary-unary-overloading) — Object Oriented Programming, chapter 5
- [City class with operator overloading](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Acity-class-operator-overload) — Object Oriented Programming, chapter 5
- [Default argument and overloading program](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Adefault-arg-overloading-program) — Object Oriented Programming, chapter 3
- [Overloading via member and non-member function](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Amember-vs-nonmember-overload) — Object Oriented Programming, chapter 5
- [Function overloading; new/delete average program](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Afunction-overloading-new-delete-average) — Object Oriented Programming, chapter 3
- [Syntax of operator overloading](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aoperator-overloading-syntax) — Object Oriented Programming, chapter 5, asked 4×

## Related in other subjects

- [Why DTFS uses only one period](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Actfs-vs-dtfs-duration) — Signals and Systems, chapter 2
- [T/F: tower height function of voltage only](https://www.bctengineer.com/question.md?key=semester_8%2Ftransmission_and_distribution_system_design%3Atf-tower-height-voltage-only) — Transmission and Distribution System Design, chapter 4, asked 2×
