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
Static Data Member In C++ | Create, Access & More (+Code Examples)

A static data member in C++ is a class member that is shared among all instances of that class. Unlike regular data members, which have separate copies for each object of the class, a static data member is common to all objects of the class.
In this article, we'll explore the characteristics, usage, and benefits of static data members in C++. We’ll also cover practical examples and discuss how static members differ from other types of class members.
What Is Static Data Member In C++?
The static data member in C++ programming is a special type of class member that is associated with the class rather than with an individual object of a class. It means that all instances of the class share the same static data member. In other words, unlike regular (non-static members) data members, which have separate copies for each object, static data members are shared among all objects of the class.
Here are some key points you should note about the static data member in C++ programming language:
- Declaration of Static Data Member in C++: A static data member in C++ is declared using the static keyword within the class definition.
- Definition of Static Data Member in C++: The static data member in C++ must be defined outside the class (usually in the source file) to allocate memory for it. This is typically done by specifying the data type and the name of the static data member, along with its initial value (if any).
- Initialization of Static Data Member in C++: We can initialize a static data member in C++ programs using a constant expression or a compile-time constant. The initialization is done outside the class definition.
- Accessing a Static Data Member in C++: We must use the class name followed by the scope resolution operator(::) and the name of the respective static data member in C++ when we want to access it.
Here's a simple example to illustrate the concept of a static data member in C++:
Imagine there’s a car manufacturing firm that produces a variety of models of cars. Each of these models has its own max_speed property (i.e., data member). Now suppose the firm wants to keep a record of the total number of models manufactured by them.
- So they define a variable model_count, which is initialized once and is incremented from its past value by 1 unit every time a new model with its own max_speed property is launched.
- So, the firm can make this data member, model_count, a static data member such that its value is accessible on a class level and is shared by all the instances of that class.
How To Declare Static Data Members In C++?
The declaration of a static data member in C++ is done using the static keyword inside the class declaration. This is because they are linked to the class as a whole rather than to specific class objects. It indicates that the same static data member, which exists independently of any particular object, is shared by all class members' objects.
Although they have the advantage of being contained within the class scope, static data members are conceptually similar to global variables within the class. As a result, information within the class is more organized and contained.
Syntax to Declare a Static Data Member In C++:
class ClassName {
access_specifier:
static data_type data_member_name;
};
Here,
- The ClassName and data_member_name refer to the names of the class and the data member we are creating.
- An access_specifier indicates the visibility of the class member, which can be private, public or protected.
- The static keyword indicates that the respective member is of a static nature and the type of data it stores is given by data_type.
Let’s understand how to declare a static data member in C++ with the help of a sample code that showcases its implementation.
Code Example:
#include <iostream>
using namespace std;
class Mercedes { // Class declaration
public:
static int modelCount; // Declaration of static data member
Mercedes() {
modelCount++; // Increment the modelCount for each object of the class created
}
};
int Mercedes::modelCount = 0; // Definition of static data member outside the class
int main() {
Mercedes m1; // Creating the first Mercedes object
Mercedes m2; // Creating the second Mercedes object
Mercedes m3; // Creating the third Mercedes object
// Accessing the static data member using the class name
cout << "Total Mercedes models: " << Mercedes::modelCount << endl;
return 0;
}
Output:
Total Mercedes models: 3
Code explanation:
In the above C++ program-
- We create a class named Mercedes with a static data member modelCount.
- The class also contains a constructor that increments the value of modelCount variable by 1 every time an object of the Mercedes class is created.
- Next, we initialize the static data member modelCount to 0, outside the class, using the scope resolution operator (::).
- In the main() function, we create three objects of the Mercedes class: m1, m2, and m3.
- Then, we access the modelCount static data member using the class name and variable name (i.e., Mercedes::modelCount).
- This allows us to retrieve the total count of Mercedes models created so far, which is printed to the console using cout.
How To Initialize/ Define Static Data Member In C++?
After you declare a static data member in the class definition, it's time to define it outside the class definition. Typically, this is done in the implementation file (.cpp) associated with the class. The definition provides the memory allocation and initialization for the static data member.
Are you wondering why defining the data member outside the class definition is necessary? We must define (or initialize) the static data members outside the class definition for two main reasons. They are:
1. Multiple Definition Error
Since all instances of a class share static data members, defining the static data member inside a C++ class might cause issues if multiple translation units (those .cpp files) are included in the class definition.
- Imagine the linker's dilemma when it tries to merge these object files into an executable. (The linker is an essential component of the software development process, specifically in the compilation of programs written in languages like C and C++. It plays a crucial role in creating the final executable file from multiple object files generated during the compilation).
- It finds multiple definitions of the same static data member lurking around, causing confusion.
- As a result, the linker presents us with that dreaded multiple-definition error.
So, defining a static data member outside the C++ class helps us avoid a situation where the program gets confused about which definition to use. It keeps things organized and allows the linker to do its job smoothly.
2. External Linkage
The static data member in C++ has a special property known as external linkage. This means that they can be accessed from other translation units (other .cpp files) in our program. However, if we define static data members inside the class, they will have internal linkage limiting their accessibility to only within the class itself.
- In simpler terms, when we define a static data member in C++ programs inside the class, it becomes like a private secret that only the class itself can access.
- But if we define it outside the class, it becomes a shared resource that other parts of our program can also access and use.
The syntax to define a static data member in C++ outside of a class definition is:
class ClassName {
public:
static data_type data_member_name;
};
data_type ClassName::data_member_name = some_initial_value;
Here, the syntax for declaration of static data member in C++ class remains the same, we just add a line of initialization outside the class definition. We use the scope resolution operator (::) to access the respective data member declared inside the class and assign the initial value given by some_inital_value.
Defining Static Data Member In C++ Using Const Keyword (Inside The Class)
While generally, we should not define a static data member inside the class, there is one exception to this. A static data member that is being created as a constant can be initialized/ defined inside the class definition itself.
When a data member is declared as static const, it means it is a constant value shared by the entire class, i.e., among all instances of the class and cannot be modified. Look at the syntax and the C++ code example below to see how this is done.
Syntax:
class ClassName {
public:
static const dataType staticConstantMemberName = initial value;
};
Here, the const keyword indicates that the static data member/ variable is constant and cannot be modified. The syntax for declaration of the constant static data member in C++ classes remains the same however, we can initialize it inside the class.
Code Example:
#include <iostream>
class MyClass {
public:
// Static constant member variable
static const int myStaticConstant = 42;
// Static member function
static int getStaticConstant() {
return myStaticConstant;
}
};
int main() {
// Accessing the static constant member variable
std::cout << "Static constant value: " << MyClass::myStaticConstant << std::endl;
// Accessing the static constant member function
std::cout << "Static constant value (via function): " << MyClass::getStaticConstant() << std::endl;
return 0;
}
Output:
Static constant value: 42
Static constant value (via function): 42
Explanation:
- We create a class MyClass and declare a public static data member myStaticConstant.
- Since we are using the const keyword in the definition, it means the data member is constant and static. So, we initialize it with the value 42 inside the class definition.
- Next, we define a static member function getStaticConstant(), which simply returns the value of the static constant member variable myStaticConstant.
- In the main() function, we access the static constant data member twice. In the first case, we use the class name with the static data member name and scope resolution operator.
- In the second case, we call the static member function using the scope resolution operator.
- We print the outcome of both cases using cout commands.
- When we print the value of MyClass::myStaticConstant, it will output 42, which is the value of the static constant member variable.
- When we call MyClass::getStaticConstant(), it returns the same value, 42, and the output will be Static constant value (via function): 42.
- This shows that we can initialize a constant static data member inside the class and access it the same as any other static data member.
Ways To Access A Static Data Member In C++
As mentioned before, a static data member in C++ belongs to the class as a whole and not the individual objects or instances of the class. This means all the objects/ instances of the class share the same static data member, which can be accessed in two different ways. One method involves directly using the class name with the scope resolution operator, and the other involves using the member functions.
We have discussed these ways of accessing a static data member in C++ in the sections ahead, along with examples for a better understanding.
How To Access Static Members Without An Object (Using Class Name)?
Since static members are associated with the class itself and not with individual objects, you can access a static data member in C++ without creating an object of the class. For this, you must use the name of the respective class followed by the scope resolution operator (::) and then the name of the static data member. This is a fundamental characteristic of static data members in C++.
Look at the sample C++ program ahead to understand how to actually access a static data member without creating an object or using one.
Code Example:
#include <iostream>
class MyClass {
public:
static int staticValue; // Static data member declaration
};
// Initialization of the static data member outside the class
int MyClass::staticValue = 42;
int main() {
// Accessing the static member without creating an object
std::cout << "Static Value: " << MyClass::staticValue << std::endl;
return 0;
}
Output:
Static Value: 42
This is a static function.
Explanation:
In the code above,
- We first define a class named MyClass and declare a static data member staticValue of type int. This static data member is shared among all instances of the class.
- Next, we initialize the static data member staticValue outside the class definition, assigning it the value 42. This step is necessary because static data members must be defined outside the class to allocate memory.
- In the main() function, we access the static member directly using the class name MyClass and the scope resolution operator (::). We print the value of staticValue to the console, which outputs 42.
- Since static members are shared and do not require an instance of the class to be accessed, we do not need to create an object of MyClass to access staticValue.
- Finally, the main function() returns 0, indicating successful completion.
How To Access Static Data Member In C++ Using Static Member Function?
In C++, you can also access static data members using a static member function. We will discuss the concept of a static member function in the next section. First, let's look at how to use it to access a static data member in C++ programs. For this, we must use the scope resolution operator along with the class name to call the respective static member function.
Here's an example demonstrating how to access a static data member in C++ using a static member function.
Code Example:
#include <iostream>
class MyClass {
public:
static int staticValue; // Static data member declaration
static int getStaticValue() {
return staticValue; // Static member function to access the static data member
}
};
// Initialization of the static data member outside the class
int MyClass::staticValue = 101;
int main() {
// Accessing the static data member using the static member function
int value = MyClass::getStaticValue();
std::cout << "Value of Static Data Member: " << value << std::endl;
return 0;
}
Output:
Value of Static Data Member: 101
Explanation:
In the above code example-
- We define a class called MyClass and declare a static data member staticValue of type int. This static member is shared across all instances of the class.
- We also declare a static member function getStaticValue() within the class. This function returns the value of the static data member staticValue.
- Outside the class, we initialize the static data member staticValue to 101. This initialization is necessary because static members must be defined outside the class to allocate storage.
- In the main() function, we call the static member function getStaticValue() using the class name MyClass and the scope resolution operator (::). This function call retrieves the value of staticValue, which is 101.
- We finally store the returned value in an integer variable value and print it to the console.
What Are Static Member Functions In C++?
Static member functions in C++ are special functions associated with a class that belongs to the class itself rather than to any specific object of the class, unlike the non-static member function. This type of member function is declared using the static keyword, just like static data members.
Syntax for Static Member Function in C++:
class ClassName {
static return_type staticFunction(list of arguments) {
// This function is a static member function.
// It does not need to be called with an object of the ClassName class.
}
};
Here,
- The static keyword indicates that the function is a static member function. This means the function belongs to the class itself, not to any specific object of that class.
- The return_type refers to the type of value the function will return.
- The list of arguments refers to the arguments accepted by the member function.
Read More: Static Member Function In C++ Explained With Proper Examples
Example Of Member Function & Static Data Member In C++
In this code example, we illustrate how static data members and member functions work in C++. We will create multiple instances of the Mercedes class, each with a unique model ID and maximum speed, while using a static member to keep track of the total number of models produced.
Code Example:
#include <iostream>Â
using namespace std;
class Mercedes {
private:
static int modelCount; // Static data member to count the number of models produced
int modelID; // Non-static data member to store a unique model ID
int maxSpeed; // Non-static data member for the maximum speed of each model
public:
explicit Mercedes(int speed) : maxSpeed(speed) {
modelID = ++modelCount; // Assign a unique ID to each model and increment the count
}
void display() const {
cout << "Model ID: " << modelID << ", Max Speed: " << maxSpeed << " km/h" << endl;
}
};
// Definition and initialization of static data member
int Mercedes::modelCount = 0;
int main() {
Mercedes A_class(250);
Mercedes C_class(300);
Mercedes S_class(200);
A_class.display(); // Output: Model ID: 1, Max Speed: 250 km/h
C_class.display(); // Output: Model ID: 2, Max Speed: 300 km/h
S_class.display(); // Output: Model ID: 3, Max Speed: 200 km/h
return 0;
}
Output:
Model ID: 1, Max Speed: 250 km/h
Model ID: 2, Max Speed: 300 km/h
Model ID: 3, Max Speed: 200 km/h
Code Explanation:
In the above code example:
- We start by defining a class called Mercedes to represent different car models.
- Within this class, we declare a static data member, modelCount, to keep track of the total number of models produced. This static variable is shared across all instances.
- We also declare two non-static data members: modelID and maxSpeed. The modelID gives each model a unique identifier, while maxSpeed stores the maximum speed for each model. These are unique to each object.
- The class has a constructor that takes an integer speed and initializes maxSpeed. It also increments modelCount and assigns the updated value to modelID, ensuring each model gets a unique ID.
- The display() function, marked as const, outputs the modelID and maxSpeed of the object, showing each model’s unique identifier and speed.
- Outside the class, we define and initialize modelCount to 0, setting up the initial state for counting models.
- In the main() function, we create instances of the Mercedes class, each with a specified maxSpeed. We then call display() on each instance to print their details, verifying the correct assignment of modelID and maxSpeed.
Practical Applications Of Static Data Member In C++
Static data members in C++ have several practical applications, including:
-
Shared Resource Tracking: We can use static data members to keep track of resources shared across all instances of a class, such as counting the number of objects created or managing a shared connection pool.
-
Global Configuration: Static data members in C++ programs allow us to store configuration settings or constants that need to be consistent across all instances, like a global logging level or application settings.
-
Memory Efficiency: Static data members reduce memory usage by sharing data among all objects. This is particularly useful when the data is the same across all instances, such as a class-wide lookup table or cache.
-
Counting: Counting or tracking the frequency of events/ specific operations is a tedious, repetitive task prevalent across industries and operations. Creating a class and using the concept of static data member in C++ can automate and hence simplify tasks such as tracking function calls, object creations, or error occurrences.
-
Storing constants: Static data members in C++ are ideal for storing constants that are shared by all objects of a class. In software development, constants are frequently used to define standardized values, such as conversion factors, maximum limits, or default settings.
Tips To Use Static Data Member In C++
Here are some tips for effectively using static data member in C++ classes:
-
Use for Shared Data: We should use static data member in C++ when we need data that is shared across all instances of a class, such as counters, configuration settings, or shared resources.
-
Initialize Carefully: Static data member in C++ must be initialized outside the class definition, typically in a .cpp file. It is done to avoid multiple definitions and to ensure proper initialization before use. This will help to prevent errors throughout your entire program.
-
Control Access: Consider using private or protected access for static data members, providing public static member functions to control how the data is accessed or modified, ensuring encapsulation and data integrity.
-
Avoid Overuse: While static data members are useful, overusing them can lead to tight coupling and reduced flexibility. We should reserve them for situations where shared state is truly necessary.
-
Thread Safety: In multithreaded applications, be mindful of thread safety when using static data members. We might need to use synchronization mechanisms like mutexes to avoid race conditions.
Conclusion
We now know that a static data member in C++ is a class member that is declared using the static keyword. There is only one copy of a static data member, regardless of how many objects of the class are created.
- A static data member in C++ can be accessed from anywhere in the program, even from outside the class, and can be used to store constants, counters, and other data that is shared by all objects of the class.
- The static data member in C++ programs is stored in the static storage duration, which means that it is allocated when the program starts and deallocated when the program ends.
- Since a static data member in C++ is not attached to a specific object, it cannot cannot be accessed using the 'this' pointer.
- Static data member can be declared const, in which case it cannot be modified after they are initialized.
Frequently Asked Questions
Q. Is there any difference between const static data_type variable_name and static const data_type variable_name?
No, there is no difference between the two. The C++ programming language allows flexibility in the placement of the const and static keywords in declarations, allowing programmers to choose a style that they find more readable or consistent with their coding conventions. The placement of the const and static keywords does not affect the behavior or meaning of the variable_name. Both declarations achieve the same result, which is to define a constant static data member in C++ programs.
Q. Can a static data member be inherited by derived classes?
Yes, a static data member in C++ base class can be inherited by derived classes. When a derived class is derived from a base class that has static data members, the derived class inherits those static data members along with other members of the base class.
Let’s understand it with an example program:
#include <iostream>
class Mercedes {
public:
static int totalModels; // Static data member shared among all objects
int maxSpeed; // Non-static data member, unique to each object
// Constructor to initialize maxSpeed and increment totalModels
Mercedes(int speed) : maxSpeed(speed) {
totalModels++; // Increment the static data member in the constructor
}
// Static member function to display total models
static void displayTotalModels() {
std::cout << "Total Mercedes Models: " << totalModels << std::endl;
}
};
// Initialization of the static data member outside the class
int Mercedes::totalModels = 0;
int main() {
Mercedes s_class(200); // Creating object of Mercedes with maxSpeed 200
Mercedes c_class(250); // Creating object of Mercedes with maxSpeed 250
Mercedes e_class(180); // Creating object of Mercedes with maxSpeed 180
// Display the total number of Mercedes models
Mercedes::displayTotalModels();
return 0;
}
Output :
Total Mercedes Models: 3
Explanation:
In this code snippet, we define a Mercedes class with a static data member totalModels that tracks the total number of Mercedes objects created.
Each time we create a new object, totalModels is incremented, and we can use a static function to display this count.
The maxSpeed member is unique to each object, representing the maximum speed of that specific model.
Q. What are the differences between const and static data members in C++?
A const data member is a member variable that cannot be modified after it has been initialized, whereas a static data member is a member variable that is shared among all instances of the class. Below is a tabular representation of the differences between the constant and the static data member in C++.
Here's a table comparing const and static data members in C++:
Aspect | const Data Member | static Data Member |
---|---|---|
Memory Allocation | Allocated separately for each object instance. | Shared among all instances of the class (single copy). |
Initialization | Must be initialized at the point of declaration inside the class (usually in the constructor). | Initialized outside the class definition. |
Access | Accessed through an object instance. | Can be accessed using the class name (without an object). |
Mutability | Immutable after initialization; cannot be changed. | Can be modified (if not declared as const). |
Lifetime | Lifetime tied to the object's lifetime. | Lifetime tied to the program's duration (static storage duration). |
Use Case | Used for values that should not change after being set, typically unique for each instance. | Used for values shared among all instances, often for counters or shared settings. |
Storage Class | const specifies immutability, not storage class. | static is a storage class specifier indicating shared memory. |
Combination with const | Cannot combine with static in the same data member. | Can be combined with const to create a shared, constant value. |
Example | const int maxAge = 100; inside a constructor. | static int count; declared in the class and defined outside. |
Q. What are the differences between const and constexpr?
In C++, both const and constexpr are used to define variables that are defined as constant and cannot be modified once initialized. However, there are a few key differences between the two, as mentioned in the table below:
Parameters |
Constant (const) |
Constant Expression (constexpr) |
Value Determination |
Determined at runtime |
Determined at compile-time |
Usage |
Any class variable (local, global, member) |
Primarily for constants and template arguments |
Expression Complexity |
Can be complex expressions or function calls |
Limited to constant expressions |
Context Dependency |
They can depend on runtime values |
Cannot depend on runtime values |
Compile-time Error |
Invalid value assignment generates a compile-time error |
Invalid value assignment generates a compile-time error |
Q. How is synchronization achieved when multiple threads access a static data member in C++?
Synchronization is essential when multiple threads access a static data member in C++ to ensure that the data remains consistent and prevent potential race conditions. A race condition occurs when two or more threads access a shared resource simultaneously, leading to unpredictable behavior and incorrect results. You can use various synchronization mechanisms to protect access to the static data member in C++, such as:
- Mutex (std::mutex): Mutex stands for mutual exclusion. It is a synchronization primitive that allows only one thread to access the protected data at a time.
- Before accessing the static data member, a thread must lock the mutex. If another thread has already locked the mutex, the requesting thread will be blocked until the other thread releases the mutex.
- Once the thread finishes its operation on the static data member, it must unlock the mutex, allowing other threads to access the data.
- Reader-Writer Locks (std::shared_mutex): Reader-writer locks allow multiple threads to read the static data simultaneously but ensure that only one thread can write to the data at any given time.
- Multiple threads can acquire a shared (read) lock, allowing concurrent access for reading.
- However, when a thread acquires an exclusive (write) lock, it prevents other threads from reading or writing until the write operation is complete.
- Atomic Operations (std::atomic): When dealing with simple data types (e.g., integer or enumeration type), atomic operations can be used to ensure that the access and modification of the static data member are atomic (indivisible). Atomic operations guarantee that a read or write operation is completed without interruption from other threads.
- Critical Sections (platform-specific): Some platforms provide specific functions or APIs to create critical sections, which act similarly to mutexes. Critical sections protect code regions, ensuring that only one thread executes the critical section at a time.
Using any of these mechanisms can help ensure synchronization when working with a static data member in C++.
Quiz Time!!!
Here are a few other interesting topics you must know about:
- C++ Type Conversion & Type Casting Demystified (With Examples)
- Pointers in C++ | A Roadmap To All Types Of Pointers With Examples
- Inline Function In C++ | Declare, Working, Examples & More!
- References In C++ | Declare, Types, Properties & More (+Examples)
- Array In C++ | Ultimate Guide On Creation, Types & More (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 1 week ago
Avinash Mishra 1 month ago
Sanchit Dhale 1 month ago