Skip to content

Tag Archives: C++-Operator Overloading

Prerequisites:  Operator Overloading Bitwise Operator in C/C++   In C++, there are a total of six bitwise operators. The six bitwise operators are bitwise AND (&),… Read More
Prerequisites:  Operators Operator Overloading Logical operators are used for combining two or more conditions or constraints or to complement the evaluation of the original condition… Read More
Stack is a linear data structure that works in a model of LIFO ( last in first out ). In which, the element pushed at… Read More
Operator Overloading is a part of Polymorphism, which enables the feature because of which we can directly use operators with user-defined classes and objects. To… Read More
In C++, we can make operators to work for user-defined classes. This means C++ has the ability to provide the operators with a special meaning… Read More
In this article, we will discuss the Overloading of the function-call operators in C++. The function call operator is denoted by “()” which is used… Read More
In this article, we will discuss the unformatted Input/Output operations In C++. Using objects cin and cout for the input and the output of data… Read More
Prerequisite: Operator Overloading in C++, Types of Operator Overloading When an object calls an operator function by passing an argument and the returned value of… Read More
Given N triangles along with the length of their three sides as a, b and c. The task is to count the number of unique… Read More
Pre-requisite: Operator Overloading in C++Given two strings. The task is to concatenate the two strings using Operator Overloading in C++. Example:  Input: str1 = "hello",… Read More
Given Q queries of type 1, 2, 3 and 4 as described below.   Type-1: Insert a number to the list. Type-2: Delete only one occurrence… Read More
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… Read More
#include<iostream> using namespace std;    class Point { private:   int x, y; public:   Point() : x(0), y(0) { }   Point& operator()(int dx, int dy);   void… Read More
Predict the output? #include<stdlib.h> #include<stdio.h> #include<iostream>    using namespace std;    class Test {     int x; public:     void* operator new(size_t size);     void operator delete(void*);     Test(int… Read More
Output of following program? #include <iostream> using namespace std; class Test2 {     int y; };    class Test {     int x;     Test2 t2; public:     operator… Read More

Start Your Coding Journey Now!