C++ Programming Language
Table of content:
- A Brief Intro To C++
- The Timeline Of C++
- Importance Of C++
- Versions Of C++ Language
- Comparison With Other Popular Programming Languages
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Variables In C++?
- Declaration & Definition Of Variables In C++
- Variable Initialization In C++
- Rules & Regulations For Naming Variables In C++ Language
- Different Types Of Variables In C++
- Different Types of Variable Initialization In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Primitive Data Types In C++?
- Derived Data Types In C++
- User-Defined Data Types In C++
- Abstract Data Types In C++
- Data Type Modifiers In C++
- Declaring Variables With Auto Keyword
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Structure Of C++ Program: Components
- Compilation & Execution Of C++ Programs | Step-by-Step Explanation
- Structure Of C++ Program With Example
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is Typedef in C++?
- The Role & Applications of Typedef in C++
- Basic Syntax for typedef in C++
- How Does typedef Work in C++?
- How to Use Typedef in C++ With Examples? (Multiple Data Types)
- The Difference Between #define & Typedef in C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Strings In C++?
- Types Of Strings In C++
- How To Declare & Initialize C-Style Strings In C++ Programs?
- How To Declare & Initialize Strings In C++ Using String Keyword?
- List Of String Functions In C++
- Operations On Strings Using String Functions In C++
- Concatenation Of Strings In C++
- How To Convert Int To Strings In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is String Concatenation In C++?
- How To Concatenate Two Strings In C++ Using The ‘+' Operator?
- String Concatenation Using The strcat( ) Function
- Concatenation Of Two Strings In C++ Using Loops
- String Concatenation Using The append() Function
- C++ String Concatenation Using The Inheritance Of Class
- Concatenate Two Strings In C++ With The Friend and strcat() Functions
- Why Do We Need To Concatenate Two Strings?
- How To Reverse Concatenation Of Strings In C++?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is Find In String C++?
- What Is A Substring?
- How To Find A Substring In A String In C++?
- How To Find A Character In String C++?
- Find All Substrings From A Given String In C++
- Index Substring In String In C++ From A Specific Start To A Specific Length
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Pointers In C++?
- Pointer Declaration In C++
- How To Initialize And Use Pointers In C++?
- Different Types Of Pointers In C++
- References & Pointers In C++
- Arrays And Pointers In C++
- String Literals & Pointers In C++
- Pointers To Pointers In C++ (Double Pointers)
- Arithmetic Operation On Pointers In C++
- Advantages Of Pointers In C++
- Some Common Mistakes To Avoid With Pointers In Cpp
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Understanding Pointers In C++
- What Is Pointer To Object In C++?
- Declaration And Use Of Object Pointers In C++
- Advantages Of Pointer To Object In C++
- Pointer To Objects In C++ With Arrow Operator
- An Array Of Objects Using Pointers In C++
- Base Class Pointer For Derived Class Object In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is 'This' Pointer In C++?
- Defining ‘this’ Pointer In C++
- Example Of 'this' Pointer In C++
- Describing The Constness Of 'this' Pointer In C++
- Important Uses Of 'this' Pointer In C++
- Method Chaining Using 'this' Pointer In C++
- C++ Programs To Show Application Of 'This' Pointer
- How To Delete The ‘this’ Pointer In C++?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is Reference?
- What is Pointer?
- Comparison Table Of C++ Pointer Vs. Reference
- Differences Between Reference And Pointer: A Detailed Explanation
- Why Are References Less Powerful Than Pointers?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- How To Declare A 2D Array In C++?
- C++ Multi-Dimensional Arrays
- Ways To Initialize A 2D Array In C++
- Methods To Dynamically Allocate A 2D Array In C++
- Accessing/ Referencing Two-Dimensional Array Elements
- How To Initialize A Two-Dimensional Integer Array In C++?
- How To Initialize A Two-Dimensional Character Array?
- How To Enter Data In Two-Dimensional Array In C++?
- Conclusion
- Frequently Asked Questions
Table of content:
- What Are Arrays Of Strings In C++?
- Different Ways To Create String Arrays In C++
- How To Access The Elements Of A String Array In C++?
- How To Convert Char Array To String?
- Conclusion
- Frequently Asked Questions
Table of content:
- What is Memory Allocation in C++?
- The “new" Operator In C++
- The "delete" Operator In C++
- Dynamic Memory Allocation In C++ | Arrays
- Dynamic Memory Allocation In C++ | Objects
- Deallocation Of Dynamic Memory
- Dynamic Memory Allocation In C++ | Uses
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is A Substring In C++ (Substr C++)?
- Example For Substr In C++
- Points To Remember For Substr In C++
- Important Applications Of substr() Function
- How to Get a Substring Before a Character?
- Print All Substrings Of A Given String
- Print Sum Of All Substrings Of A String Representing A Number
- Print Minimum Value Of All Substrings Of A String Representing A Number
- Print Maximum Value Of All Substrings Of A String Representing A Number
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is Operator In C++?
- Types Of Operators In C++ With Examples
- What Are Arithmetic Operators In C++?
- What Are Assignment Operators In C++?
- What Are Relational Operators In C++?
- What Are Logical Operators In C++?
- What Are Bitwise Operators In C++?
- What Is Ternary/ Conditional Operator In C++?
- Miscellaneous Operators In C++
- Precedence & Associativity Of Operators In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is The New Operator In C++?
- Example To Understand New Operator In C++
- The Grammar Elements Of The New Operator In C++
- Storage Space Allocation
- How Does The C++ New Operator Works?
- What Happens When Enough Memory In The Program Is Not Available?
- Initializing Objects Allocated With New Operator In C++
- Lifetime Of Objects Allocated With The New Operator In C++
- What Is The Delete Operator In C++?
- Difference Between New And Delete Operator In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Types Of Overloading In C++
- What Is Operator Overloading In C++?
- How To Overload An Operator In C++?
- Overloadable & Non-overloadable Operators In C++
- Unary Operator Overloading In C++
- Binary Operator Overloading In C++
- Special Operator Overloading In C++
- Rules For Operator Overloading In C++
- Advantages And Disadvantages Of Operator Overloading In C++
- Function Overloading In C++
- What Is the Difference Between Operator Functions and Normal Functions?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Operators In C++?
- Introduction To Logical Operators In C++
- Types Of Logical Operators In C++ With Example Program
- Logical AND (&&) Operator In C++
- Logical NOT(!) Operator In C++
- Logical Operator Precedence And Associativity In C++
- Relation Between Conditional Statements And Logical Operators In C++
- C++ Relational Operators
- Conclusion
- Frequently Asked Important Interview Questions:
- Test Your Skills: Quiz Time
Table of content:
- Different Type Of C++ Bitwise Operators
- C++ Bitwise AND Operator
- C++ Bitwise OR Operator
- C++ Bitwise XOR Operator
- Bitwise Left Shift Operator In C++
- Bitwise Right Shift Operator In C++
- Bitwise NOT Operator
- What Is The Meaning Of Set Bit In C++?
- What Does Clear Bit Mean?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Types of Comments in C++
- Single Line Comment In C++
- Multi-Line Comment In C++
- How Do Compilers Process Comments In C++?
- C- Style Comments In C++
- How To Use Comment In C++ For Debugging Purposes?
- When To Use Comments While Writing Codes?
- Why Do We Use Comments In Codes?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Storage Classes In Cpp?
- What Is The Scope Of Variables?
- What Are Lifetime And Visibility Of Variables In C++?
- Types of Storage Classes in C++
- Automatic Storage Class In C++
- Register Storage Class In C++
- Static Storage Class In C++
- External Storage Class In C++
- Mutable Storage Class In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Decision Making Statements In C++
- Types Of Conditional Statements In C++
- If-Else Statement In C++
- If-Else-If Ladder Statement In C++
- Nested If Statements In C++
- Alternatives To Conditional If-Else In C++
- Switch Case Statement In C++
- Jump Statements & If-Else In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is A Switch Statement/ Switch Case In C++?
- Rules Of Switch Case In C++
- How Does Switch Case In C++ Work?
- The break Keyword In Switch Case C++
- The default Keyword In C++ Switch Case
- Switch Case Without Break And Default
- Advantages & Disadvantages of C++ Switch Case
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is A For Loop In C++?
- Syntax Of For Loop In C++
- How Does A For Loop In C++ Work?
- Examples Of For Loop Program In C++
- Ranged Based For Loop In C++
- Nested For Loop In C++
- Infinite For Loop In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is A While Loop In C++?
- Parts Of The While Loop In C++
- C++ While Loop Program Example
- How Does A While Loop In C++ Work?
- What Is Pre-checking Process Or Entry-controlled Loop?
- When Are While Loops In C++ Useful?
- Example C++ While Loop Program
- What Are Nested While Loops In C++?
- Infinite While Loop In C++
- Alternatives To While Loop In C++
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are Loops & Its Types In C++?
- What Is A Do-While Loop In C++?
- Do-While Loop Example In C++ To Print Numbers
- How Does A Do-While Loop In C++ Work?
- Various Components Of The Do-While Loop In C++
- Example 2: Adding User-Input Positive Numbers With Do-While Loop
- C++ Nested Do-While Loop
- C++ Infinitive Do-while Loop
- What is the Difference Between While Loop and Do While Loop in C++?
- When To Use A Do-While Loop?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Are 2D Vectors In C++?
- How To Declare 2D Vector In C++?
- How To Initialize 2D Vector In C++?
- C++ Program Examples For 2D Vectors
- How To Access & Modify 2D Vector Elements In C++?
- Methods To Traverse, Manipulate & Print 2D Vectors In C++
- Adding Elements To 2-D Vector Using push_back() Function
- Removing Elements From Vector In C++ Using pop_back() Function
- Creating 2D Vector In C++ With User Input For Size Of Column & Row
- Advantages of 2D Vectors Over Traditional Arrays
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- How To Print A Vector In C++ By Overloading Left Shift (<<) Operator?
- How To Print Vector In C++ Using Range-Based For-Loop?
- Print Vector In C++ With Comma Separator
- Printing Vector In C++ Using Indices (Square Brackets/ Double Brackets & at() Function)
- How To Print A Vector In C++ Using std::copy?
- How To Print A Vector In C++ Using for_each() Function?
- Printing C++ Vector Using The Lambda Function
- How To Print Vector In C++ Using Iterators?
- Conclusion
- Frequently Asked Questions
Table of content:
- Definition Of C++ Find In Vector
- Using The std::find() Function
- How Does find() In Vector C++ Function Work?
- Finding An Element By Custom Comparator Using std::find_if() Function
- Use std::find_if() With std::distance()
- Element Find In Vector C++ Using For Loop
- Using The find_if_not Function
- Find Elements With The Linear Search Approach
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Sort() Function In C++?
- Sort() Function In C++ From Standard Template Library
- Exceptions Of Sort() Function/ Algorithm In C++
- The Stable Sort() Function In C++
- Partial Sort() Function In C++
- Sorting In Ascending Order With Sort() Function In C++
- Sorting In Descending Order With Sort Function In C++
- Sorting In Desired Order With Custom Comparator Function & Sort Function In C++
- Sorting Elements In Desired Order Using Lambda Expression & Sort Function In C++
- Types of Sorting Algorithms In C++
- Advanced Sorting Algorithms In C++
- How Does the Sort() Function Algorithm Work In C++?
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Function Overloading In C++?
- Ways Of Function Overloading In C++
- Function Overloading In C++ Using Different Types Of Parameters
- Function Overloading In C++ With Different Number Of Parameters
- Function Overloading In C++ Using Different Sequence Of Parameters
- How Does Function Overloading In C++ Work?
- Rules Of Function Overloading In C++
- Why Is Function Overloading Used?
- Types Of Function Overloading Based On Time Of Resolution
- Causes Of Function Overloading In C++
- Ambiguity & Function Overloading In C++
- Advantages Of Function Overloading In C++
- Disadvantages Of Function Overloading In C++
- Operator Overloading In C++
- Function Overriding In C++
- Difference Between Function Overriding & Function Overloading In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is An Inline Function In C++?
- How To Define The Inline Function In C++?
- How Does Inline Function In C++ Work?
- The Need For An Inline Function In C++
- Can The Compiler Ignore/ Reject Inline Function In C++ Programs?
- Normal Function Vs. Inline Function In C++
- Classes & Inline Function In C++
- Understanding Inline, __inline, And __forceinline Functions In C++
- When To Use An Inline Function In C++?
- Advantages Of Inline Function In C++
- Disadvantages Of Inline Function In C++
- Why Not Use Macros Instead Of An Inline Function In C++?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is Static Data Member In C++?
- How To Declare Static Data Members In C++?
- How To Initialize/ Define Static Data Member In C++?
- Ways To Access A Static Data Member In C++
- What Are Static Member Functions In C++?
- Example Of Member Function & Static Data Member In C++
- Practical Applications Of Static Data Member In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is A Constant In C++?
- Ways To Define Constant In C++
- What Are Literals In C++?
- Pointer To A Constant In C++
- Constant Function Arguments In C++
- Constant Member Function Of Class In C++
- Constant Data Members In C++
- Object Constant In C++
- Conclusion
- Frequently Asked Questions(FAQ)
Table of content:
- What Is Friend Function In C++?
- Declaration Of Friend Function In C++ With Example
- Characteristics Of Friend Function In C++
- Global Friend Function In C++ (Global Function As Friend Function )
- Member Function Of Another Class As Friend Function In C++
- Function Overloading Using Friend Function In C++
- Advantages & Disadvantages Of Friend Function in C++
- What Is A C++ Friend Class?
- A Function Friendly To Multiple Classes
- C++ Friend Class Vs. Friend Function In C++
- Some Important Points About Friend Functions And Classes In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Function Overriding In C++?
- The Working Mechanism Of Function Overriding In C++
- Real-Life Example Of Function Overriding In C++
- Accessing Overriding Function In C++
- Accessing Overridden Function In C++
- Function Call Binding With Class Objects | Function Overriding In C++
- Function Call Binding With Base Class Pointers | Function Overriding In C++
- Advantages Of Function Overriding In C++
- Variations In Function Overriding In C++
- Function Overloading In C++
- Function Overloading Vs Function Overriding In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- Errors In C++
- What Is Exception Handling In C++?
- Exception Handling In C++ Program Example
- C++ Exception Handling: Basic Keywords
- The Need For C++ Exception Handling
- C++ Standard Exceptions
- C++ Exception Classes
- User-Defined Exceptions In C++
- Advantages & Disadvantages Of C++ Exception Handling
- Conclusion
- Frequently Asked Questions
Table of content:
- What Are Templates In C++ & How Do They Work?
- Types Of Templates In C++
- What Are Function Templates In C++?
- C++ Template Functions With Multiple Parameters
- C++ Template Function Overloading
- What Are Class Templates In C++?
- Defining A Class Member Outside C++ Template Class
- C++ Template Class With Multiple Parameters
- What Is C++ Template Specialization?
- How To Specify Default Arguments For Templates In C++?
- Advantages Of C++ Templates
- Disadvantages Of C++ Templates
- Difference Between Function Overloading And Templates In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- Structure
- Structure Declaration
- Initialization of Structure
- Copying and Comparing Structures
- Array of Structures
- Nested Structures
- Pointer to a Structure
- Structure as Function Argument
- Self Referential Structures
- Class
- Object Declaration
- Accessing Class Members
- Similarities between Structure and Class
- Which One Should You Choose?
- Key Difference Between a Structure and Class
- Summing Up
- Test Your Skills: Quiz Time
Table of content:
- What Is A Class And Object In C++?
- What Is An Object In C++?
- How To Create A Class & Object In C++? With Example
- Access Modifiers & Class/ Object In C++
- Member Functions Of A Class In C++
- How To Access Data Members And Member Functions?
- Significance Of Class & Object In C++
- What Are Constructors In C++ & Its Types?
- What Is A Destructor Of Class In C++?
- An Array Of Objects In C++
- Object In C++ As Function Arguments
- The this (->) Pointer & Classes In C++
- The Need For Semicolons At The End Of A Class In C++
- Difference Between Structure & Class In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Are Static Members In C++?
- Static Member Functions in C++
- Ways To Call Static Member Function In C++
- Properties Of Static Member Function In C++
- Need Of Static Member Functions In C++
- Regular Member Function Vs. Static Member Function In C++
- Limitations Of Static Member Functions In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Constructor In C++?
- Characteristics Of A Constructor In C++
- Types Of Constructors In C++
- Default Constructor In C++
- Parameterized Constructor In C++
- Copy Constructor In C++
- Dynamic Constructor In C++
- Benefits Of Using Constructor In C++
- How Does Constructor In C++ Differ From Normal Member Function?
- Constructor Overloading In C++
- Constructor For Array Of Objects In C++
- Constructor In C++ With Default Arguments
- Initializer List For Constructor In C++
- Dynamic Initialization Using Constructor In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is A Constructor In C++?
- What Is Constructor Overloading In C++?
- Dеclaration Of Constructor Ovеrloading In C++
- Condition For Constructor Overloading In C++
- How Constructor Ovеrloading In C++ Works?
- Examples Of Constructor Overloading In C++
- Lеgal & Illеgal Constructor Ovеrloading In C++
- Types Of Constructors In C++
- Characteristics Of Constructors In C++
- Advantage Of Constructor Overloading In C++
- Disadvantage Of Constructor Overloading In C++
- Conclusion
- Frеquеntly Askеd Quеstions
Table of content:
- What Is A Destructor In C++?
- Rules For Defining A Destructor In C++
- When Is A Destructor in C++ Called?
- Order Of Destruction In C++
- Default Destructor & User-Defined Destructor In C++
- Virtual Destructor In C++
- Pure Virtual Destructor In C++
- Key Properties Of Destructor In C++ You Must Know
- Explicit Destructor Calls In C++
- Destructor Overloading In C++
- Difference Between Normal Member Function & Destructor In C++
- Important Uses Of Destructor In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is A Constructor In C++?
- What Is A Destructor In C++?
- Difference Between Constructor And Destructor In C++
- Constructor In C++ | A Brief Explanation
- Destructor In C++ | A Brief Explanation
- Difference Between Constructor And Destructor In C++ Explained
- Order Of Calling Constructor And Destructor In C++ Classes
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is Type Conversion In C++?
- What Is Type Casting In C++?
- Types Of Type Conversion In C++
- Implicit Type Conversion (Coercion) In C++
- Explicit Type Conversion (Casting) In C++
- Advantages Of Type Conversion In C++
- Disadvantages Of Type Conversion In C++
- Difference Between Type Casting & Type Conversion In C++
- Application Of Type Casting In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is A Copy Constructor In C++?
- Characteristics Of Copy Constructors In C++
- Types Of Copy Constructors In C++
- When Do We Call The Copy Constructor In C++?
- When Is A User-Defined Copy Constructor Needed In C++?
- Types Of Constructor Copies In C++
- Can We Make The Copy Constructor In C++ Private?
- Assignment Operator Vs Copy Constructor In C++
- Example Of Class Where A Copy Constructor Is Essential
- Uses Of Copy Constructors In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- Why Do You Need Object-Oriented Programming (OOP) In C++?
- OOPs Concepts In C++ With Examples
- The Class OOPs Concept In C++
- The Object OOPs Concept In C++
- The Inheritance OOPs Concept In C++
- Polymorphism OOPs Concept In C++
- Abstraction OOPs Concept In C++
- Encapsulation OOPs Concept In C++
- Other Features Of OOPs In C++
- Benefits Of OOP In C++ Over Procedural-Oriented Programming
- Disadvantages Of OOPS Concept In C++
- Why Is C++ A Partial OOP Language?
- Conclusion
- Frequently Asked Questions
Table of content:
- Introduction To Abstraction In C++
- Types Of Abstraction In C++
- What Is Data Abstraction In C++?
- Understanding Data Abstraction In C++ Using Real Life Example
- Ways Of Achieving Data Abstraction In C++
- What Is An Abstract Class?
- Advantages Of Data Abstraction In C++
- Use Cases Of Data Abstraction In C++
- Encapsulation Vs. Abstraction In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Encapsulation In C++?
- How Does Encapsulation Work In C++?
- Types Of Encapsulation In C++
- Why Do We Need Encapsulation In C++?
- Implementation Of Encapsulation In C++
- Access Specifiers & Encapsulation In C++
- Role Of Access Specifiers In Encapsulation In C++
- Member Functions & Encapsulation In C++
- Data Hiding & Encapsulation In C++
- Features Of Encapsulation In C++
- Advantages & Disadvantages Of Encapsulation In C++
- Difference Between Abstraction and Encapsulation In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Inheritance In C++?
- What Are Child And Parent Classes?
- Syntax And Structure Of Inheritance In C++
- Implementing Inheritance In C++
- Importance Of Inheritance In C++
- Types Of Inheritance In C++
- Visibility Modes Of Inheritance In C++
- Access Modifiers & Inheritance In C++
- How To Make A Private Member Inheritable?
- Member Function Overriding In Inheritance In C++
- The Diamond Problem | Inheritance In C++ & Ambiguity
- Ways To Avoid Ambiguity Inheritance In C++
- Why & When To Use Inheritance In C++?
- Advantages Of Inheritance In C++
- The Disadvantages Of Inheritance In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Hybrid Inheritance In C++?
- Importance Of Hybrid Inheritance In Object Oriented Programming
- Example Of Hybrid Inheritance In C++: Using Single and Multiple Inheritance
- Example Of Hybrid Inheritance In C++: Using Multilevel and Hierarchical Inheritance
- Real-World Applications Of Hybrid Inheritance In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Multiple Inheritance In C++?
- Examples Of Multiple Inheritance In C++
- Ambiguity Problem In Multiple Inheritance In C++
- Ambiguity Resolution In Multiple Inheritance In C++
- The Diamond Problem In Multiple Inheritance In C++
- Visibility Modes In Multiple Inheritance In C++
- Advantages & Disadvantages Of Multiple Inheritance In C++
- Multiple Inheritance Vs. Multilevel Inheritance In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Multilevel Inheritance In C++?
- Block Diagram For Multilevel Inheritance In C++
- Multilevel Inheritance In C++ Example
- Constructor & Multilevel Inheritance In C++
- Use Cases Of Multilevel Inheritance In C++
- Multiple Vs Multilevel Inheritance In C++
- Advantages & Disadvantages Of Multilevel Inheritance In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is Hierarchical Inheritance In C++?
- Example 1: Hierarchical Inheritance In C++
- Example 2: Hierarchical Inheritance In C++
- Impact of Visibility Modes In Hierarchical Inheritance In C++
- Advantages And Disadvantages Of Hierarchical Inheritance In C++
- Use Cases Of Hierarchical Inheritance In C++
- Conclusion
- Frequently Asked Questions
Table of content:
- What Are Access Specifiers In C++?
- Types Of Access Specifiers In C++
- Public Access Specifiers In C++
- Private Access Specifier In C++
- Protected Access Specifier In C++
- The Need For Access Specifiers In C++
- Combined Example For All Access Specifiers In C++
- Best Practices For Using Access Specifiers In C++
- Why Can't Private Members Be Accessed From Outside A Class?
- Conclusion
- Frequently Asked Questions
Table of content:
- What Is The Diamond Problem In C++?
- Example Of The Diamond Problem In C++
- Resolution Of The Diamond Problem In C++
- Virtual Inheritance To Resolve Diamond Problem In C++
- Scope Resolution Operator To Resolve Diamond Problem In C++
- Conclusion
- Frequently Asked Questions
The 'this' Pointer In C++ | Declare, Use, Code Examples & More

The 'this' pointer is a unique pointer variable that is often used within classes. It holds the address of class objects and makes it easy for member function to access data members. In other words, it is a powerful concept in object-oriented programming languages that allows objects to refer to themselves within their own scope.
In this article, we will explore the purpose and behavior of 'this' pointer in C++, examine how it is used in various scenarios, and understand its significance and applications for object-oriented design.
What Is 'This' Pointer In C++?
The 'this' pointer in C++ is an implicit pointer available within non-static member functions of a class or structure. It points to the current object instance, letting the object access its own member variables and functions.
Let's have a look at the syntax of the 'this' pointer in C++ programming language and then an example for better understanding.
Syntax Of 'this' Pointer In C++
When creating or using the 'this' pointer, the 'this' keyword is used in conjunction with the arrow operator (->) along with the name of the member or method being referred to. The syntax for it is as follows:
void functionName() {
this->memberName = value;
}
Here,
- functionName refers to the identifier/ name you have given to the function.
- The term this-> represents the 'this' pointer in C++, and memberName refers to the respective member of the class you are trying to access.
An example showcasing the syntax in action is given below:
class MyClass {
public:
void myMethod() {
this->myMember = 42;
}
private:
int myMember;
};
Explanation:
In the above code snippet, we are trying to access the myMember variable/ attribute of the current object through the expression this->myMember, which is being assigned a value of 42 within the myMethod() function definition.
Defining ‘this’ Pointer In C++
In C++ programming, each object of a class has its own set of member variables/ attributes (also known as data members) and member functions.
- When a member function is called on an object, the 'this' pointer is automatically passed as a hidden argument to the member function.
- It enables the member function to have access to the object's data members (i.e., the class member variable) and call other member functions.
Note: Friend functions in C++ do not have access to this pointer.
Example Of 'this' Pointer In C++
The sample program given below demonstrates the implementation of the 'this' pointer in C++.
Code Example:
#include <iostream>
class Person {
private:
std::string name;
int age;
public:
Person(const std::string& name, int age) {
this->name = name;
this->age = age;
}
void displayInfo() {
std::cout << "Name: " << this->name << std::endl;
std::cout << "Age: " << this->age << std::endl;
}
void updateAge(int newAge) {
this->age = newAge;
}
};
int main() {
Person person("Armaan", 25);
person.displayInfo();
person.updateAge(30);
std::cout << "After updating age:" << std::endl;
person.displayInfo();
return 0;
}
Output:
Name: Armaan
Age: 25
After updating age:
Name: Armaan
Age: 30
Explanation:
In this C++ code example, we have a Person class with private member variables/ data members: name and age. Inside the class-
- We have a class constructor that takes a reference to string variable name (string& name) and integer data type variable age as input.
- It initializes these data members with the values name and age, accessing them using the 'this' pointer.
- We also define a void member function called displayInfo(), which prints the current values of data members using the 'this' pointer (to access) and cout command to display.
- After that, we define another void member function, updateAge(), which takes an integer parameter newAge as input and updates the value of the age data member using the 'this' pointer.
- Inside the main() function, we create an object of class type Person, called person. Here, the initial values for data members, name and age are Armaan and 25, respectively.
- Then, we call the displayInfo() function on the object person to print the initial values to the console.
- Following this, we call the updateAge() function with 30 as input on the person object. This updates the value of age data member to 30.
- Once again, we call the displayInfo() function to print the updated age value to the console.
Also read: Static Member Function In C++ Explained With Proper Examples
Describing The Constness Of 'this' Pointer In C++
In C++, the constness of the 'this' pointer is an important aspect of understanding how member functions interact with class objects. We know that it is a special pointer available within nonstatic member function calls of a class, pointing to the object on which the member function is invoked.
The constness of the 'this' pointer in C++ is closely tied to whether the member function that uses it is marked as const.
- Const Member Function: When a member function is marked as const, it guarantees that it will not modify the state of the object. The 'this' pointer within such a function is treated as pointing to a constant object (const MyClass*). This means that within the function, you cannot alter any non-static member variables of the class.
- Non-Const Member Function: When a member function is not marked as const, the 'this' pointer is treated as pointing to a non-constant object (MyClass*). This allows the function to modify the state of the object.
Let's look at a code example to understand the concept better.
Code Example:
#include <iostream>
class MyClass {
public:
void foo() const {
std::cout << "The foo() function is called on const object with value: " << this->x << std::endl;
// 'this' pointer is a pointer to a constant object
// cannot modify the object's state
}
void bar() {
std::cout << "The bar() function is called on non-const object with value: " << this->x << std::endl;
// 'this' pointer is a non-const pointer to the object
// can modify the object's state
this->x += 10;
}
int getX() const {
return this->x;
}
private:
int x;
};
int main() {
MyClass obj1;
obj1.bar();
std::cout << "The value of x after calling bar(): " << obj1.getX() << std::endl;
const MyClass obj2 = MyClass();
obj2.foo();
std::cout << "The value of x after calling foo(): " << obj2.getX() << std::endl;
return 0;
}
Output:
The bar() function is called on non-const object with value: 0
The value of x after calling bar(): 10
The foo() function is called on const object with value: 0
The value of x after calling foo(): 0
Explanation:
In this C++ code segment-
- We define a class called MyClass containing a private data member x and a constant foo() function, which prints a string message to the console when called.
- As mentioned in the code comments, the 'this' pointer used in this function is pointing to a constant object.
- Then, we define another function bar(), which also prints a message when called. Since this is non-constant, the 'this' pointer will also point to a non-constant object.
- Inside this function, we use the 'this' pointer to access data member x and use the compound assignment function to assign a new value that is incremented by 10.
- Lastly, in the class, we have a get () function which uses the 'this' pointer to access the value of variable x and returns the same.
- In the main() function, we create an object obj1 of type MyClass.
- Then, we call the bar() function on obj1 and use a cout command to print the value of x variable. Since x is uninitialized at this point (has a garbage value), the function increments it by 10.
- Following this, we call the getX() function on obj1 inside the cout command. This prints the value of x as updated by bar().
- Next, we create another object obj2 of type cont MyClass and call the foo() function on it.
- This function attempts to print the value of x, which is also a garbage value since it is uninitialized. Since obj2 is const, it cannot be modified. So the expression this->x += 10 results in a compilation error.
- After calling the foo() function, we call the getx() function on obj2 inside a coout command, which again accesses and prints its value.
Important Uses Of 'this' Pointer In C++
The 'this' pointer has several applications and uses. Here are some common scenarios where we use the 'this' pointer in C++ programs:
- Distinguishing between local variables and member variables: When a member variable has the same name as a local variable or parameter within a member function, the 'this' pointer in C++ allows you to explicitly refer to the member variable. This distinction helps avoid ambiguity and allows you to access or modify the intended class member variable.
- Returning the current object from a member function: Member functions can return the current object using the 'this' pointer in C++. This enables method chaining, where multiple member functions can be called on the same object in a single expression. It provides a concise and fluent style of programming.
- Accessing member variables and methods within member functions: The 'this' pointer in C++ provides a way to access and manipulate data members and member functions within other member functions. It allows for explicit reference to the single object itself, enabling operations on its state or invoking other member functions.
- Passing the current object as a parameter: The 'this' pointer in C++ can be passed as a parameter to other methods within a class. This allows those functions to operate on the current object, providing access to its state and behaviour.
- Resolving naming conflicts and accessing shadowed variables: When there is a naming conflict between member variables and local variables, the C++ 'this' pointer helps resolve the conflict by allowing explicit access to the member variables. It ensures that the intended variables are accessed and modified correctly.
- Callbacks and event handling: The 'this' pointer in C++ is often used in event-driven programming and callbacks. It allows event handlers or callback functions to access and operate on the object that registered the event or callback.
- Implementation of copy assignment and copy constructor: In the implementation of the copy assignment operator and copy constructor, the C++ 'this' pointer is used to reference the object being assigned or copied from. This helps in correctly copying the object's state.
These are some of the common applications of the 'this' pointer in C++. It provides a way to refer to the current object within member functions, enabling proper access and manipulation of member variables and methods.
Method Chaining Using 'this' Pointer In C++
Method chaining in C++ involves returning the object itself from each method so that subsequent methods can be called on the same object.
- It is a programming technique that allows multiple methods to be called sequentially on the same object instance without the need for intermediate variables or separate function calls.
- The result is a concise and readable code structure that promotes fluent interfaces.
- In method chaining, each method call modifies the object's state and returns a reference to the modified object.
- This allows subsequent methods to be called directly on the returned object, creating a chain of method invocations.
Let's look at an example showcasing the method chaining concept using the 'this' pointer in C++.
Code Example:
#include <iostream>
class Calculator {
private:
int value;
public:
Calculator(int initialValue) : value(initialValue) {}
Calculator& add(int num) {
value += num;
return *this;
}
Calculator& subtract(int num) {
value -= num;
return *this;
}
Calculator& multiply(int num) {
value *= num;
return *this;
}
Calculator& divide(int num) {
value /= num;
return *this;
}
int getResult() const {
return value;
}
};
int main() {
Calculator calc(10);
int result = calc.add(5).multiply(2).subtract(3).divide(4).getResult();
std::cout << "Result: " << result << std::endl;
return 0;
}
Output:
Result: 6
Explanation:
- In this example, we have a Calculator class with member functions that perform various arithmetic operations on the input value.
- Each method modifies the value member variable and returns a reference to the current object using the *this pointer.
- Inside the main() function, we create an object of class Calculator called calc and initialize it with the value of 10.
- We then chain functions, i.e., chain multiple method calls, applying arithmetic operations to the object and store the outcome in the result variable.
- Here we use the dot operator to chain and access the functions on the object calc. Lastly, we retrieve the result by calling getResult() function.
- By using method chaining, we can perform a series of arithmetic operations on the Calculator object in a single line of code, making the code more readable and concise.
- Finally, we print the value of the result variable using the std::cout statement.
Method chaining is a powerful technique that can be applied to various programming scenarios, such as configuration builders, query builders, and fluent interfaces. It enhances code expressiveness, improves readability, and reduces the need for temporary variables, resulting in more maintainable and efficient code.
C++ Programs To Show Application Of 'This' Pointer
Returning An Object Using The 'this' Pointer In C++
In C++, an object is returned to the caller in the form of a copy whenever a function does so. This might be helpful whenever the caller has to save the function's result for later use or utilize it to do further tasks in a C++ program.
Syntax:
Classname FunctionName() {
// Code to create and initialize an object
return object;
}
Here,
- Classname refers to the name of the current class whose object is being returned.
- FunctionName is the name of the function that returns the object, and object is the class instance in question.
Code Example:
#include <iostream>
using namespace std;
class Point {
private:
int x, y;
public:
Point(int x = 0, int y = 0) : x(x), y(y) {}
Point operator+(Point const &obj) const {
Point res;
res.x = x + obj.x;
res.y = y + obj.y;
return res;
}
void display() const {
cout << "x = " << x << ", y = " << y << endl;
}
};
int main() {
Point p1(10, 15), p2(5, 10);
Point p3 = p1 + p2; // returns an object of Point class
p3.display();
return 0;
}
Output:
x = 15, y = 25
Explanation:
In the sample C++ program-
- We create a Point class, which represents a point in a two-dimensional space. It has two private member variables, x, and y, representing the coordinates of the point.
- Then, we define a constructor that initializes these variables with 0, facilitating the creation of a point without any coordinates.
- Next, we define an overloaded function operator+() to add two Point objects. It takes constant reference to an object as input and returns a new point object after adding two points.
- Lastly, inside the class, we define the display() function, which uses cout commands to print the values of both data members.
- Inside the main() function-
- We create two objects of Point objects, p1 and p2, with coordinates (10, 15) and (5, 10), respectively.
- Then, we call the operator+() function on the object to add the two points thus creating a new point p3.
- Next, we call the display() function on the new point p3 to display its value.
- Lastly, the program terminates with a return 0 statement, indicating a successful execution.
Distinguishing Between Local Variables & Member Variables
In C++, the 'this' pointer is an implicit pointer that is essential for differentiating between member variables and local variables, especially when they have the same name. This distinction is crucial when assigning values to member variables or when retrieving their current state.
-
Local Variables are variables declared within a function body or a block of code. They are only accessible within the scope of that function or block.
-
Class Member Variables are variables declared within a class. They are accessible by all member functions of the class and represent the state of an object.
When local variables and member variables have the same name, you can use the 'this' pointer to refer to the member variables explicitly. The 'this' pointer points to the current object instance, allowing you to access its member variables.
Code Example:
#include <iostream>
class MyClass {
private:
int value; // Member variable
public:
void setValue(int value) {
this->value = value; // Accessing member variable using 'this' pointer
}
void printValue(int value) const {
std::cout << "Local value: " << value << std::endl;
std::cout << "Member value: " << this->value << std::endl; // Accessing member variable using 'this' pointer
}
};
int main() {
MyClass obj;
int value = 5; // Local variable
obj.setValue(10);
obj.printValue(20);
obj.printValue(value);
return 0;
}
Output:
Local value: 20
Member value: 10
Local value: 5
Member value: 10
Explanation:
In this example, the MyClass has a private member variable/ data member called value. The member function setValue() sets the value of the member variable using the parameter passed to it.
- The printValue() member function demonstrates the distinction between the local variable and the member variable with the same name. It takes an integer parameter named value.
- Within the function, we use the 'this' pointer to access the member variable explicitly and print its value.
- In the main() function, we declare a local variable named value and initialize with the value 5.
- Then, we call the setValue() function on the object obj, setting the member variable to 10.
- Subsequently, the printValue() member function is called twice, once with the value 20 as a parameter and once with the local variable value as a parameter.
Resolve Shadowing Issue Using 'this' Keyword In C++
The 'this' pointer in C++ can be used to resolve ambiguity whenever there is a shadowing issue in C++. That is, whenever a local variable or parameter has the same name as a member variable, the 'this' pointer can be used to explicitly refer to the member variable.
For example, the expression this->memberVariable, clearly indicates that we are trying to access a class data member called memberVariable. It helps differentiate between the local variable and the member variable. Let's take a look at an example of how that's done.
Code Example:
#include <iostream>
class MyClass {
private:
int count;
public:
MyClass(int count) : count(count) {
// Resolving shadowing issue using 'this' pointer
}
void printCount(int count) const {
std::cout << "Local count: " << count << std::endl;
std::cout << "Member count: " << this->count << std::endl; // Accessing member variable
}
};
int main() {
MyClass obj(5);
obj.printCount(10);
return 0;
}
Output:
Local count: 10
Member count: 5
Explanation:
In this example, the MyClass has a member variable called count, and the constructor takes an integer parameter with the same name.
- Here, we use the 'this' pointer to resolve the shadowing issue and differentiate between the local parameter and the member variable.
- Inside the constructor, the expression this->count refers to the member variable, while the term count refers to the local parameter.
- We ensure that the member variable is correctly initialized by assigning the value of the parameter to the member variable using the 'this' pointer.
- Now, in the printCount() member function, we have both a local variable count and a member variable count.
- So, we resolve the shadowing issue by using the 'this' pointer (i.e., this->count) and explicitly accessing the member variable.
Using the 'this' pointer to resolve shadowing issues allows for explicit access to the member variables of a class, even when local variables or parameters have the same names. It ensures that the intended variables are accessed, avoiding ambiguity and ensuring correct behavior within the class methods.
Constructor & 'this' Pointer In C++
In C++, a constructor is a special member function that is automatically called when an object of a class is instantiated. It is responsible for initializing the object's member variables and setting up the initial state of the object. The 'this' pointer, which is implicitly available within non-static member functions, plays a crucial role during this initialization process.
Specifically, within a constructor, 'this' points to the object being created, allowing the constructor to distinguish between member variables and parameters with the same name. By using the 'this' pointer, a constructor can assign values to member variables, ensuring that the object is correctly initialized with the desired state. We have discussed a similar example in the section 'Resolve Shadowing Issue Using 'this' Keyword In C++' above.
Access Currently Executing Object Using 'this' Keyword In C++
The 'this' keyword in C++ allows you to navigate to the object that is currently running inside a member function of a class or struct. This enables you to call the member functions and variables of the object from a function.
Code Example:
#include <iostream>
class MyClass {
private:
int value;
public:
MyClass(int value) : value(value) {}
void printValue() const {
std::cout << "Value of the current object: " << this->value << std::endl;
}
void compareValues(const MyClass* other) const {
if (this->value == other->value) {
std::cout << "The values are equal." << std::endl;
} else {
std::cout << "The values are not equal." << std::endl;
}
}
};
int main() {
MyClass obj1(10);
MyClass obj2(20);
obj1.printValue();
obj2.printValue();
obj1.compareValues(&obj2);
return 0;
}
Output:
Value of the current object: 10
Value of the current object: 20
The values are not equal.
Explanation:
In this example, the MyClass has a member variable called value. The constructor initializes the member variable using the parameter passed to it.
- The printValue() member function uses the 'this' pointer to access the member variable of the current object explicitly. It then prints the value of the member variable.
- The compareValues() member function demonstrates the use of the 'this' pointer to access the member variables of the current object and another object passed as a pointer. It compares the values of the member variables and prints a message accordingly.
- In the main() function, we create two objects of the MyClass: obj1 with value 10 and obj2 with value 20.
- Then, we call the printValue() member function is called on each object, printing their respective values.
- After that, we call the compareValues() member function on obj1, passing &obj2 as the argument to compare the values of both objects.
Calling Member Functions Using 'this' Keyword In C++
In C++, the 'this' pointer is used to call member functions within other member functions of a class. The 'this' pointer represents the current object, and using it to call member functions allows you to perform operations on the same object from within its own member functions. An example of the same is given below.
Code Example:
#include <iostream>
class MyClass {
public:
void foo() {
std::cout << "Calling foo()..." << std::endl;
}
void bar() {
std::cout << "Calling bar()..." << std::endl;
this->foo(); // Calling foo() using the 'this' pointer
}
};
int main() {
MyClass obj;
obj.bar();
return 0;
}
Output:
Calling bar()...
Calling foo()...
Explanation:
In the above C++ program, the MyClass has two member functions: foo() and bar().
- Here, the bar() function calls the foo() function using the 'this' pointer.
- Inside the bar() function, this->foo() is used to call the foo() member function on the current object.
- The 'this' pointer represents the object on which the bar() function is called.
- In the main() function, an object of the MyClass is created, and its bar() member function is called.
How To Delete The ‘this’ Pointer In C++?
It is important to note that one cannot explicitly delete the 'this' operator in C++. That is, the 'this' pointer is automatically managed by the language and does not need to be explicitly deleted.
- We know that the lifetime and deallocation of objects are handled by the language's memory management mechanisms.
- For example, stack allocation, automatic destruction, or manual deallocation through the 'delete' operator for dynamically allocated objects.
- The 'this' pointer is implicitly available within the scope of nonstatic functions of a class. It is a hidden pointer that points to the current object for which the member function is called.
- The program execution environment manages an object's memory, and the memory is released when the object goes out of scope or is explicitly deallocated.
The example below showcases the working mechanism behind this process.
Code Example:
#include <iostream>
class MyClass {
public:
MyClass() {
std::cout << "Constructor called. this = " << this << std::endl;
}
~MyClass() {
std::cout << "Destructor called. this = " << this << std::endl;
}
};
int main() {
MyClass* obj = new MyClass();
std::cout << "Object address: " << obj << std::endl;
delete obj;
return 0;
}
Output:
Constructor called. this = 0x12345678 (Example address)
Object address: 0x12345678 (Example address)
Destructor called. this = 0x12345678 (Example address)
Explanation:
In this example, the MyClass has a constructor and a destructor.
- The constructor is called when the object is created, and the destructor is called when the object is destroyed or explicitly deallocated.
- In the main() function, a dynamic object of MyClass is created using the new operator, and its address is assigned to the obj pointer.
- The delete operator is then used to deallocate the object.
Conclusion
The 'this' pointer is a fundamental feature of C++ that plays a crucial role in object-oriented programming. It provides a way for member functions to access the address of the current object. It induces a range of functionalities from chaining method calls to implementing operator overloading. By understanding how to effectively use the 'this' pointer, we can write more intuitive and advanced-level development programs that help us enhance the power of C++'s object-oriented principles.
Frequently Asked Questions
Q. When is the this pointer used?
The this pointer is used in non-static member functions to refer to the current object instance. It is particularly useful for distinguishing between member variables and parameters with the same name, and for returning the current object from methods for method chaining.
Q. How many types of pointers are there in C++?
In C++, pointers can be classified into several types based on their usage and the kind of data they point to. Here are the main types:
-
Null Pointer: A pointer that is explicitly initialized to nullptr (or NULL in older code) to indicate that it is not pointing to any valid memory location.
-
Void Pointer: A generic pointer that can point to any data type. It must be cast to another pointer type before dereferencing. It is used when the data type of the pointer is unknown or not important.
-
Pointer to Object: Points to an object of a specific class or structure. It allows access to the object's members and methods.
-
Pointer to Member: Points to a member of a class. It is used to access or modify the members of a class through a pointer. This type of pointer requires special syntax and is less commonly used.
-
Pointer to Function: Points to a function, allowing dynamic invocation of functions. It can be used to pass functions as arguments or to implement callbacks.
Q. How does the 'this' pointer assist in method chaining?
The 'this' pointer facilitates method chaining by allowing member functions to return a reference to the current object (*this). This enables calling multiple methods on the same object in a single statement.
Q. What is a pointer to a derived class in C++?
A pointer that points to an object type of a derived class is referred to as a pointer to a derived class in C++.
- In other words, when you create a pointer that points to a derived class object, it can be referred to as a pointer to a derived class.
- The pointer to a derived class is especially useful when using a base class pointer to access the members or functions of a derived class (i.e., polymorphism).
Q. What is 'this' pointer function in CPP?
The keyword 'this' in C++ indicates a pointer to the currently selected object. The 'this' pointer is a hidden pointer that is implicitly passed to an object member function as the first function argument when it is called on an object.
- In a class member function, the current object can be specifically referred to using the 'this' pointer in C++.
- The member variable of the current object is, for instance, denoted by "this->memberVariable."
Test Your Skills: Quiz Time
You might also be interested in reading:
- Typedef In C++ | Syntax, Application & How To Use It (With Examples)
- Inline Function In C++ | Declare, Working, Examples & More!
- C++ Templates | Class, Function, & Specialization (With Examples)
- C++ Type Conversion & Type Casting Demystified (With Examples)
- Bitwise Operators In C++ Explained In Detail With Examples
An economics graduate with a passion for storytelling, I thrive on crafting content that blends creativity with technical insight. At Unstop, I create in-depth, SEO-driven content that simplifies complex tech topics and covers a wide array of subjects, all designed to inform, engage, and inspire our readers. My goal is to empower others to truly #BeUnstoppable through content that resonates. When I’m not writing, you’ll find me immersed in art, food, or lost in a good book—constantly drawing inspiration from the world around me.
Comments
Add commentLogin to continue reading
And access exclusive content, personalized recommendations, and career-boosting opportunities.

Subscribe
to our newsletter
Kartik Deshmukh 6 days ago
Ritik Mishra 1 month ago
YASH SRIVASTAVA 1 month ago
Avinash Mishra 1 month ago
Sanchit Dhale 1 month ago
Sunita Bhat 1 month ago