C++ Pointer Operator

In this chapter we are going to study C++ Pointer Operators. C++ provides two pointer operators one is value at operator or indirection operator and address operator. C++ Pointer OperatorC++ Address of Operator (&)The & is a unary operator means it requires only one operand. The Address of Operator returns the memory address of its operand. Address of operator has the same precedence and right-to-left associativity as that of other unary operators. Symbol for the bitwise AND and the address of operator are [...]

C++ Conditional Operator

Conditional Operator [?:] : Ternary Operator in C++Conditional operators are also called as Ternary Operator. They are represented by ?: Ternary Operator takes on 3 Arguments.Syntax of Ternary Operator:Expression_1 ? Expression_2 : Expression_3whereExpression_1 is Condition Expression_2 is statement followed if Condition is True Expression_3 is statement followed if Condition is FalseExplanation of syntax:Expression_1 is a condition so it will return the result either True or False. If result of expression_1 is True that is NON-ZERO, then Expression_2 is Executed. If result of expression_1 is False [...]

C++ sizeof Operator

C++ sizeof Operatorsizeof is a compile-time operator used to calculate the size of data type or variable. sizeof operator will return the size in integer format. sizeof is a keyword. sizeof operator can be nested.Syntax of sizeof Operator:sizeof(data type)Data type include variables, constants, classes, structures, unions, or any other user defined data type. Examples of sizeof operator: Size of Data Types#include <iostream> using namespace std; int main() { cout << "Size of int : " << sizeof(int) << endl; cout << [...]

C++ Destructor Basics

In the previous chapter we have learnt about the C++ constructors and basic type of constructors. In this chapter we will be learning about C++ Destructor Basics C++ Destructor BasicsDestructors are special member functions of the class required to free the memory of the object whenever it goes out of scope. Destructors are parameterless functions. Name of the Destructor should be exactly same as that of name of the class. But preceded by '~' (tilde). Destructors does not have any return type. [...]

C++ Bitwise Operators

In this section we are going to study C++ Bitwise operator, its importance and basic operating principle. C++ Programming Bitwise Operators:In programming, unlike byte level operations, we may need to do bit level calculations by operating on the individual data bit. C++ gives us various bitwise operators for manipulation of bits. C++ Bitwise Operators operates on Integer and character data types only. C++ Bitwise Operators does not operates on float, double. There are 6 Bitwise Operators in C++.List of Bitwise OperatorsExamples of Bitwise Operators: One's [...]

C++ Assignment Operator

C++ assignment Operator basicsAssignment Operator is used to assign value to an variable. Assignment Operator is denoted by equal to (=) sign. This operator copies the value at the right side of the operator into the left side variable. Assignment Operator is binary operator. Assignment Operator has higher precedence than comma operator only. Assignment Operator has lower precedence than all other operators except comma operator.Ways of Using Assignment Operator: In this section we are going to see different ways in which Assignment Operator can be [...]

C++ Logical Operator

In this tutorial we will study C++ logical operator in detail. C++ logical operators are used mostly inside the condition statement such as if,if...else where we want multiple conditions. C++ Logical OperatorLogical Operators are used if we want to compare more than one condition. Depending upon the requirement, proper logical operator is used. Following table shows us the different C++ operators available.Operators Name of the Operator Type&& AND Operator Binary|| OR Operator Binary! NOT Operator [...]

C++ Relational Operators

C++ Relational operators specify the relation between two variables by comparing them. There are 5 relational operators in C C++ Relational Operators In C++ Programming, the values stored in two variables can be compared using following operators and relation between them can be determined.Various C++ relational operators available are- Operator, Meaning > ,Greater than >= , Greater than or equal to == , Is equal to != , Is not equal to < , Less than or equal to

C++ Constructor basic concept

In this tutorial we will learnt about C++ constructor basic concept. Tutorial explains you everything about constructor in C++ in easier language. C++ Constructor basic conceptC++ constructors are the special member function of the class which are used to initialize the objects of that class The constructor of class is automatically called immediately after the creation of the object. Name of the constructor should be exactly same as that of name of the class. C++ constructor is called only once in a lifetime [...]

C++ Overloading assignment operator

We already know the assignment operator in C++. In this tutorial we will be learning concept of C++ Overloading assignment operator. Assignment operator in C++Assignment Operator is Used to assign value to an variable. Assignment operator is denoted by equal to sign. Assignment operator have Two values L-Value and R-value. Operator copies R-Value into L-Value. It is a binary operator.C++ Overloading Assignment OperatorC++ Overloading assignment operator can be done in object oriented programming. By overloading assignment operator, all values of one object [...]