Cascading of Input/Output Operators in C++
Prerequisite: Operator Overloading in C++, Types of Operator Overloading...
read more
How to convert a class to another class type in C++?
Pre-requisite: Type Conversion in C++, Advanced C++ | Conversion OperatorsThrough class conversion, one can assign data that belongs to a particular class type to an object that belongs to another class type. Example: Let there be two classes ‘A’ and ‘B’. If we want to allocate the details that belong to class ‘A’ to an object of class ‘B’ then this can be achieved by –...
read more
C++ map having key as a user define data type
C++ map stores keys in ordered form (Note that it internally use a self balancing binary search tree). Ordering is internally done using operator ” < " So if we use our own data type as key, we must overload this operator for our data type....
read more
Overloading of function-call operator in C++
In this article, we will discuss the Overloading of the function-call operators in C++....
read more
How to Overload the Multiplication Operator in C++?
In C++, the multiplication operator is a binary operator that is used to find the product of two numeric values. In this article, we are going to learn how to overload the multiplication operator for a class in C++....
read more
Typecast Operator Overloading in C++
In C++, the typecast operator can be overloaded to customize the behavior of casting operators to define how user-defined data types can be converted into other types. This enables developers to define how instances of a class are converted to other types, providing more control over implicit type conversions....
read more
Overloading Relational Operators in C++
In C++, operator overloading is used to redefine the behavior of already existing operators. Similarly, overloading the relational operators is commonly used to compare the instances of user-defined classes. By overloading these operators we can easily define the behavior of comparisons for the objects of a given class....
read more
Overloading Subscript or array index operator [] in C++
The Subscript or Array Index Operator is denoted by ‘[]’. This operator is generally used with arrays to retrieve and manipulate the array elements. This is a binary or n-ary operator and is represented in two parts:...
read more
Unformatted input/output operations In C++
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 of various types is possible because of overloading of operator >> and << to recognize all the basic C++ types. The operator >> is overloaded in the istream class and operator << is overloaded in the ostream class....
read more
Operator Overloading in C++
in C++, Operator overloading is a compile-time polymorphism. It is an idea of giving special meaning to an existing operator in C++ without changing its original meaning....
read more
How to Overload the Arrow Operator (->) in C++?
C++ has the ability to redefine the function of operators for the objects of some class. This is called operator overloading. In this article, we will learn how to overload the arrow operator (->) in C++....
read more
How to Overload the Function Call Operator () in C++?
In C++, operator overloading allows the user to redefine the behavior of an operator for a class. Overloading the function call operator () allows you to treat objects like functions enabling them to be called as if they were functions. Such classes are called functors in C++....
read more