C++ Function and Operator Overloading MCQs: 12 Solved Questions

Solve 12 bank-backed C++ MCQs on overload resolution, operator rules, member signatures, conversion functions, polymorphism, and expression tracing.

KnowledgeGate Team

Exam prep & CS education

Updated 8 Nov 20267 min read
C++ Function and Operator Overloading MCQs: 12 Solved Questions

Function overloading, operator overloading, and runtime polymorphism are easy to mix together. In an MCQ, the difference often comes down to one small rule about a signature, an operator symbol, or an implicit object. The Coding & Skill Development Courses category places these rules beside broader C++ practice. Attempt every option set before reading its explanation.

1. Function overloading and operator overloading in one page

Three-path C++ overload dispatch for int, double, and Matrix addition, with a runtime-dispatch footer.

In compile-time polymorphism, the compiler chooses among known function or operator candidates from the call expression and argument types. Function overloading gives one name multiple parameter lists. Operator overloading gives an existing C++ operator behaviour for an object type; it creates no new symbol. A virtual-function call, in contrast, can use runtime dispatch.

Consider these overloads:

cpp
int add(int a, int b);
double add(double a, double b);

For add(4, 7), the compiler selects int add(int, int) and computes 4 + 7 = 11. For add(2.5, 1.5), it selects double add(double, double) and computes 2.5 + 1.5 = 4.0.

For member binary operator Matrix operator+(Matrix B), let A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. The implicit left operand is this = A; B is the one explicit operand. Entry-wise addition gives [[1+5, 2+6], [3+7, 4+8]] = [[6, 8], [10, 12]].

A diagram shows compile-time selection for int and double add calls and matrix addition, with runtime dispatch noted below.

For overload-resolution ranking and default-argument ambiguity, use Function Overloading and Default Arguments in C++; this question set focuses on operator legality, member signatures, and exam practice.

2. Questions 1-3: What overloading means and which signatures are valid

Question 1

Asked in UPPSC Polytechnic Lecturer 2022. Question 1 solved page

Operator overloading is -

  • A. making new C++ operators

  • B. making C++ operators work with objects

  • C. giving C++ operators more than they can handle

  • D. helping in reducing execution time

Answer: B. An existing operator gains behaviour for an object type. No new symbol is invented, and this does not optimise execution time.

Question 2

Asked in UGC NET 2017. Question 2 solved page

Which one of the following is correct for overloaded functions in C++ ?

  • A. Compiler sets up a separate function for every definition of function.

  • B. Compiler does not set up a separate function for every definition of function.

  • C. Overloaded functions cannot handle different types of objects.

  • D. Overloaded functions cannot have same number of arguments.

Answer: A. Each valid overload is a distinct candidate with its own parameter signature. The compiler selects a match at the call. Overloads may have the same arity when parameter types differ.

Question 3

Asked in Kendriya Vidyalaya Sangathan 2013. Question 3 solved page

Which of the following is not true for overloaded functions C++?

  • A. Overloaded functions should have different argument lists.

  • B. Overloaded functions having the same argument lists should have a different return type.

  • C. Functions cannot be overloaded on the basis of one being static and the other non-static.

  • D. None of these

Answer: B. Return type alone cannot distinguish overloads. int convert(int x) and double convert(int x) have the same parameter list, so the pair is invalid at declaration level. convert(5) cannot choose by return type.

Vary the parameter list in a way overload resolution can see. Return type, static alone, and execution speed do not create an overload.

3. Questions 4-7: Operators that C++ does not let you overload

Question 4

Asked in Navodaya Vidyalaya Samiti 2019. Question 4 solved page

Which of the following C++ operators CANNOT be overloaded?

  • A. Equal (==)

  • B. Multiplication (*)

  • C. Scope resolution (::)

  • D. Logical AND (&&)

Answer: C. For user-defined types, ==, *, and && are overloadable; scope resolution :: is not. Overloaded && does not preserve built-in short-circuit behaviour.

Question 5

Asked in Indian Space Research Organization 2017. Question 5 solved page

Which of the following operator(s) cannot be overloaded?

  • A. . (Member Access or Dot operator)

  • B. ?: (Ternary or Conditional Operator )

  • C. :: (Scope Resolution Operator)

  • D. All of the above

Answer: D. Member access ., conditional ?:, and scope resolution :: are all non-overloadable, so “All of the above” is correct.

Question 6

Asked in UGC NET 2017. Question 6 solved page

Which of the following operators cannot be overloaded in C/C++ ?

  • A. Bitwise right shift assignment

  • B. Address of

  • C. Indirection

  • D. Structure reference

Answer: D. Here “Structure reference” means member access .. The other choices are overloadable in C++: >>=, unary &, and unary *. Overloading is a C++ feature even though the question is labelled C/C++.

Question 7

Asked in UGC NET 2013. Question 7 solved page

Which of the following operators can not be overloaded in C+ + ?

  • A. ∗

  • B. + =

  • C. = =

  • D. : :

Answer: D. Read the spaced source notation as *, +=, ==, and ::. The first three are overloadable; scope resolution is not.

Dot, conditional, and scope resolution are common exam traps. Other special operators exist, so classify the exact symbol before choosing an option.

4. Questions 8-9: Member operator signatures and conversion operators

Question 8

Asked in DSSSB 2022. Question 8 solved page

In C++, the "+" operator is overloaded (as member operator function) in user defined class Matrix that adds two matrices and returns resultant matrix. Which of the following is a signature of this operator function?

  • A. Matrix operator + (Matrix A, Matrix B)

  • B. Matrix operator + (Matrix B)

  • C. Matrix + operator (Matrix A, Matrix B)

  • D. Void + operator (Matrix B)

Answer: B. In member expression A + B, A is implicit and only B is an explicit parameter. For A + B, entry-wise addition gives [[1+5, 2+6], [3+7, 4+8]] = [[6, 8], [10, 12]].

Question 9

Asked in TCS 2026. Question 9 topic practice. Questions 9, 10, and 11 lead to the topic practice hub rather than individual solution pages.

Which of the following operator functions cannot be global, i.e., must be a member function.

  • A. new

  • B. delete

  • C. Conversion Operator

  • D. All of the above

Answer: C. A conversion function uses its class context and must be a non-static member. operator new and operator delete can exist globally, so “All of the above” is wrong.

Check whether an operator is a member or non-member. For a member binary operator, locate the implicit left operand. Then Question 8 follows from syntax, not memorised wording.

5. Questions 10-12: Member access, kinds of polymorphism, and overload tracing

Question 10

Asked in Navodaya Vidyalaya Samiti 2017. Question 10 solved page

The operator used to access member functions of a class from its object is

  • A. ' / '

  • B. ' . ' / '. '

  • C. : / :

  • D. +/ +

Answer: B. Option B contains the dot operator. In student.print(), . connects object student to member function print().

Question 11

Asked in RSSB 2022. Question 11 solved page

How many types of polymorphisms are supported by C++?

  • A. 1

  • B. 2

  • C. 3

  • D. 4

Answer: B. The expected kinds are compile-time polymorphism, represented by function and operator overloading, and runtime polymorphism, represented by virtual-function overriding. See object-oriented technology explained for context.

Question 12

Asked in Indian Space Research Organization 2017. Question 12 solved page

Assuming the exam-intended left-to-right evaluation of the multiplication expression, what is the expected output of this C++ program?

cpp
#include <iostream>
using namespace std;

void square(int *x)
{
    *x = (*x)++ * (*x);
}

void square(int *x, int *y)
{
    *x = (*x) * --(*y);
}

int main()
{
    int number = 30;
    square(&number, &number);
    cout << number;
    return 0;
}
  • A. 910

  • B. 920

  • C. 870

  • D. 900

Answer: C. Two arguments select square(int*, int*); the other overload is irrelevant. Both pointers alias number. Under the question's stated left-to-right convention, the left factor supplies 30, pre-decrement makes the right factor 29, and the intended calculation is 30 * 29 = 870. This is not defined C++ behaviour. In the actual multiplication, one operand reads the scalar while the other modifies it without sequencing, so the program has undefined behaviour and no portable output.

Member access uses the dot operator, the standard exam classification expects two types of polymorphism, and argument count selects the two-parameter overload before the trace begins.

6. Common traps in function and operator overloading

Trap

Why it fails

Fix

Return type alone

It cannot distinguish convert(5)

Change the parameter list

Every operator is overloadable

., ?:, and :: recur as counterexamples here

Classify the symbol before reading distractors

Binary member operator takes two explicit parameters

The left operand is this

Use Matrix operator+(Matrix B)

Trace before resolving the overload

Irrelevant function bodies waste time

Match arity and types, then compute 30 × 29 = 870

Use this six-step routine:

  1. Classify the item: function overloading, operator legality, member syntax, or runtime polymorphism.

  2. Mark parameter count and types.

  3. Cross out return-type-only distinctions.

  4. Find the implicit object for a member operator.

  5. Resolve the overload, then trace values.

  6. Mentally translate spaced symbols such as : : to :: before choosing an answer.

7. Short answer key and the next practice step

Answer key: 1-B, 2-A, 3-B, 4-C, 5-D, 6-D, 7-D, 8-B, 9-C, 10-B, 11-B, 12-C.

At 10-12, revise specific misses. At 7-9, repeat signatures and non-overloadable operators. At 0-6, rebuild the C++ base before another timed set.

For structured placement-oriented C++ practice, use Coding For Placements. It offers C, C++, Java, Python, competitive coding, concept videos, coding questions, and practice tests.

Next, redo Questions 3, 5, 8, and 12 without notes. Together they test signature validity, forbidden operators, implicit operands, and overload-first tracing.