Skip to content

Tag Archives: cpp-operator

The dot (.) operator is used for direct member selection via object name. In other words, it is used to access the child object. Syntax:… Read More
Assignment operators are used to assigning value to a variable. The left side operand of the assignment operator is a variable and right side operand… Read More
Operator Overloading:   C++ provides a special function to change the current functionality of some operators within its class which is often called as operator overloading.… Read More
Ternary operator also known as conditional operator uses three operands to perform operation. Syntax :   op1 ? op2 : op3; Nested Ternary operator: Ternary operator can… Read More
Given a program that uses an iterator, the task is to find the type of iterator used. Examples: Input : vector.begin() Output : Random_Access Iterator… Read More
The task is to Add two number using ‘-‘ operator. Examples:  Input : 2 3 Output : 5 Input : 10 20 Output : 30… Read More
In C/C++, Increment operators are used to increase the value of a variable by 1. This operator is represented by the ++ symbol. The increment… Read More
Delete is an operator that is used to destroy array and non-array(pointer) objects which are created by new expression.  Delete can be used by either… Read More
Left Shift : Denoted as : <<  Eg: N<<i (N: first operand, i: second operand) Takes two numbers, left shifts the bits of the first… Read More
Array classes are generally more efficient, light-weight, and reliable than C-style arrays. The introduction of array class from C++11 has offered a better alternative for… Read More
Stringizing operator (#) This operator causes the corresponding actual argument to be enclosed in double quotation marks. The # operator, which is generally called the… Read More
How to implement ternary operator in C++ without using conditional statements.In the following condition: a ? b: c If a is true, b will be executed. Otherwise,… Read More
Comparing String using Relational operators, Using compare() Relational operators vs std::string::compare() Return Value : Relational operators return boolean value, while compare() returns unsigned integer. Parameters… Read More
Unary operator: are operators that act upon a single operand to produce a new value. Types of unary operators: unary minus(-) increment(++) decrement(- -) NOT(!)… Read More
Consider the following statement in C and predict its output. printf("%d %d %d", i, ++i, i++); This statement invokes undefined behavior by referencing both ‘i’… Read More

Start Your Coding Journey Now!