C++ Programming Notes

Lessons

Concepts of OOPS ( Object Oriented Programming System ) in C++

Preview

Length: 10 minutesComplexity: Easy

Concepts of OOPS ( Object Oriented Programming System ) in C++ Different concepts of OOPS are  as follows Object Anything having some properties and behavior is called an object. Example Bike is an object having properties like color, make, model. Behavior of bike includes speeding up the bike , applying brakes etc. In C++, object …

Structure of a C++ Program | Components of C++ Program

Preview

Length: 10 minutesComplexity: Easy

Structure of a C++ Program | Components of C++ Program Structure of a C++ Program contains different parts as follows Documentation Section Link Section Definition Section Global Declaration Section main() function Section Subprogram Section [User Defined Function Section] Documentation Section In this section we can specify the name of program along with details of developer …

Basic concepts of C++

Preview

Length: 10 minutesComplexity: Easy

Basic concepts of C++ Character Set of C++ These are the characters which we can use in C++ . Character set includes following characters Alphabets ( a-z, A-Z ) Digits (0-9) Special Characters ( #,+,-,*, \ , / etc.) White Spaces (Blank Space, Backspace, tab etc.) Token in C++ Smallest identifiable parts of a Program …

What is a variable in C++ | Declaration of variables in C++ 

Preview

Length: 10 minutesComplexity: Easy

What is a variable in C++ What is a variable in C++? A variable is the name given to some memory location . Variable can change its value during the execution of a C++ program. Rules to define a variable in C++   – Alphabets and digits both can be used. – Variable must start with …

Constant in C++ | Literals in C++ 

Preview

Length: 10 minutesComplexity: Easy

Constant in C++ | Literals in C++  What is a constant in C++? It is a quantity whose value we can’t change during the execution of program. They are of two types. Numeric Constant Character Constant Numeric Constant Numeric Constants contain digits only. They are of two types Integer Constant Floating point Constant Integer Constant …

Data Types in C++ | Primary Data Types of C++ 

Preview

Length: 10 minutesComplexity: Easy

Data Types in C++ | Primary Data Types of C++  What is a Data type in C++? Data type  specifies the type and range of values that can be stored in a variable. Different types of data types in C++ are Primary Data Types Derived Data Types User Defined Data Types Primary Data Types in …

Derived Data Types of C++ | Secondary Data Types of C++ 

Preview

Length: 10 minutesComplexity: Easy

Derived Data Types of C++ | Secondary Data Types of C++  What is Data type ? Data type gives the type and range of values that can be stored in a variable in C++. Different types of data types are Primary Data Types Derived Data Types User Defined Data Types DERIVED DATA TYPES OF C++ Derived …

User Defined Data Types of C++ | enumerated data type in C++ | typedef in C++

Preview

Length: 10 minutesComplexity: Easy

User Defined Data Types of C++ | enumerated data type in C++ | typedef in C++ What is Data type ? Data type gives the type and range of values that can be stored in a variable in C++. Different types of data types are Primary Data Types Derived Data Types User Defined Data Types User …

Operators in C++ | Types of operators in C++

Preview

Length: 10 minutesComplexity: Easy

Operators in C++ | Types of operators in C++ Operators in C++ Operator is a symbol in C++ to perform calculations and other manipulations on values. Operand Operand is defined as the values which are used for perform calculations or manipulations. Example: 10-5                            …

Unary operators in C++

Preview

Length: 10 minutesComplexity: Easy

Unary operators in C++ Unary operators in C++ are those operators which have single operand. They are of following types: 1. Unary Plus (+) This operator specifies that a number is positive. It is optional to put this operator before a number as a number without sign is considered positive automatically. Example: +14, 45  2. …

Increment operator in C++ | Decrement operator in C++

Preview

Length: 10 minutesComplexity: Easy

Increment operator in C++ | Decrement operator in C++ Increment operator in C++  ++ is known as Increment operator in C++. It adds one to the existing value of a variable of numeric or char type.  It can be used in two ways: Prefix Form of Increment operator in C++  In prefix form, increment operator …

Binary Operators in C++ | 5 Types of binary operators in C++

Preview

Length: 10 minutesComplexity: Easy

Binary Operators in C++ | 5 Types of binary operators in C++ Binary Operators in C++ These are the operators which can have two operands. 5 Types of binary operators in C++ Various categories of binary operators in C++ are: – Arithmetic Operators – Relational Operators – Logical Operators – Bitwise Operators – Shorthand Operators …

Arithmetic Operators in C++ | Types of Arithmetic operators in C++

Preview

Length: 10 minutesComplexity: Easy

Arithmetic Operators in C++ | Types of Arithmetic operators in C++ Arithmetic Operators in C++ Arithmetic Operators in C++ can do mathematical calculations on numeric values that may exist in the form of variables or constants. Different arithmetic operators in C++ are: i. + + is called Addition operator.  It can add numeric values in C++. …

6 Types of relational operators in C++

Preview

Length: 10 minutesComplexity: Easy

6 Types of relational operators in C++ There are 6 Types of relational operators in C++. They are used to compare numeric values. These values may be in the form of literals or variables.  The result of relational operator is either 1 or 0. i. <  < is known as Less than operator.  It checks …

3 Types of logical operators in C++

Preview

Length: 10 minutesComplexity: Easy

3 Types of logical operators in C++ Logical operators combine relational expressions. The output of a logical expression is always 1 or 0. There are 3 Types of logical operators in C++ as follows: i. Logical AND operator in C++ (&&) &&(Double Ampersand)  is known as  Logical AND  operator in C++.  If any input to …

Conditional Operator in C++ | Ternary operator in C++

Preview

Length: 10 minutesComplexity: Easy

Conditional Operator in C++ | Ternary operator in C++ Conditional Operator in C++ | Ternary operator in C++ ?: symbol represents conditional operator in C++. Conditional operator is also known as ternary operator as this operator has three operands.  It always tests a condition. Depending upon the result of condition, a specific instruction get executed. Syntax: Condition? …

Assignment operators in C++ | Shorthand operators in C++

Preview

Length: 10 minutesComplexity: Easy

Assignment operators in C++ | Shorthand operators in C++ Assignment operators in C++ | Shorthand operators in C++ Assignment operators in C++ are also known as shorthand operators in C++. They are used to update the existing value of a variable in an easy way. Various Assignment operators in C++ are: Operator Description Example = It is …

6 Types of bitwise operators in C++

Preview

Length: 10 minutesComplexity: Easy

6 Types of bitwise operators in C++ There are 6 Types of bitwise operators in C++. These operators can manipulate bits of a numeric value. These operator are:  **Value is converted into  into equivalent binary form before applying bitwise operators. i. Bitwise AND operator in C++  (&) & (ampersand sign) represents Bitwise AND operator in …

3 types of special operators in C++ | sizeof() in C++ | Comma operator in C++

Preview

Length: 10 minutesComplexity: Easy

3 types of special operators in C++  3 types of special operators in C++  These operators have special purpose in C++. Special operators in C++ are : – sizeof() – Comma (,) – Scope resolution operator (::) i. sizeof() in C++ sizeof() finds the size of a data type or value in term of bytes. …

Working of scope resolution operator in C++ (::)

Preview

Length: 10 minutesComplexity: Easy

Working of scope resolution operator in C++ (::) Working of scope resolution operator in C++ (::) :: (Double colon) represents scope resolution operator in C+.  It can be used in multiple ways in C++. i. To refer global variables Scope resolution operator in C++can refer global variable in a C++ program. #include<iostream> using namespace std; …

Precedence of operators in C++ | Associativity of operators in C++ 

Preview

Length: 10 minutesComplexity: Easy

Precedence of operators in C++ | Associativity of operators in C++  Precedence of operators in C++ | Associativity of operators in C++  i. Precedence of operators in C++ Precedence is the priority given to  each operator. Multiple operator in an expression get evaluated depending upon their precedence i.e. operator having higher precedence gets evaluated first …

Implicit type conversion in C++ | Automatic type conversion in C++

Preview

Length: 10 minutesComplexity: Easy

Implicit type conversion in C++ | Automatic type conversion in C++ Implicit type conversion in C++ | Automatic type conversion in C++ Implicit conversion in C++ is also called automatic type conversion in C++. It is the process in which output of arithmetic expression automatically gets converted into a specific data type. Basic rule of …

Explicit type conversion in C++ | Type casting in C++

Preview

Length: 10 minutesComplexity: Easy

Explicit type conversion in C++ | Type casting in C++ Explicit type conversion in C++ | Type casting in C++ Explicit type conversion in C++ is also called  casting. We can use casting to convert output of an arithmetic expression into a specific data type . Syntax (Data_Type) Expression Data_Type is any valid data type of …

Comments in C++ | Single line comments in C++ | Multiline comments in C++

Preview

Length: 10 minutesComplexity: Easy

Comments in C++ | Single line comments in C++ | Multiline comments in C++ Comments in C++ Comments are user defined messages written by a programmer inside a program. Comments can be used to mention program name, program’s purpose or any information which can be helpful at a later stage for review of the program. Compiler …