Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
C++
3.8K+ articles
Difference Between
3.1K+ articles
C++ Programs
1.5K+ articles
Functions
58+ articles
cpp-class
58+ articles
Static Keyword
24+ articles
Memory Management
18+ articles
cpp-storage-classes
4+ articles
C++-Friend function and class
1+ articles
C++-Static Keyword
12 posts
Recent Articles
Popular Articles
How to Declare a Static Member Function in a Class in C++?
Last Updated: 23 July 2025
In C++, static functions are functions that are directly associated with a class so we can access the static function directly without creating an object of the class usin...
read more
C++ Programs
C++
Picked
cpp-class
C++-Class and Object
C++-Static Keyword
CPP-OOPs
CPP Examples
How to Declare a Static Data Member in a Class in C++?
Last Updated: 23 July 2025
In C++, when we declare a member as static, then it means that the member will have only one copy that is shared by all objects of that class and we don't need any object ...
read more
C++ Programs
C++
Picked
cpp-class
C++-Static Keyword
CPP-OOPs
CPP Examples
How to Declare a Static Variable in a Class in C++?
Last Updated: 23 July 2025
In C++, a static variable is initialized only once and exists independently of any class objects so they can be accessed without creating an instance of the class. In this...
read more
C++ Programs
C++
Picked
cpp-class
C++-Static Keyword
Static Keyword
CPP-OOPs
CPP Examples
Static Member Function in C++
Last Updated: 06 August 2025
A static member function in C++ is a function that belongs to the class rather than any specific object of the class. It is declared using the static keyword inside the cl...
read more
Technical Scripter
C++
Picked
Technical Scripter 2022
C++-Static Keyword
Difference between static and constant function in C++
Last Updated: 23 July 2025
Static Function: It is a member function that is used to access only static data members. It cannot access non-static data members not even call non-static member function...
read more
C++ Programs
C++
Functions
C++-Static Keyword
Difference between Static and Friend Function in C++
Last Updated: 23 July 2025
Static Function: It is basically a member function that can be called even when the object of the class is not initialized. These functions are associated with any object ...
read more
Difference Between
C++
Functions
C++-Static Keyword
C++-Friend function and class
Memory Allocation in Static Data Members in C++
Last Updated: 15 July 2025
C++ allows defining static data members within a class using the static keyword. When a data member is declared as static, then we must keep the following note in mind: ...
read more
C++
Memory Management
C++-Static Keyword
Count the number of objects using Static member function
Last Updated: 29 March 2020
Prerequisite : Static variables , Static FunctionsWrite a program to design a class having static member function named showcount() which has the property of displaying th...
read more
C++
C++-Static Keyword
Static Keyword
Static Objects in C++
Last Updated: 23 July 2025
Prerequisite: Static Keyword in C++An object becomes static when a static keyword is used in its declaration. Static objects are initialized only once and live until the p...
read more
C++
cpp-class
cpp-storage-classes
cpp-constructor
C++-Static Keyword
Static Keyword
Comparison of static keyword in C++ and Java
Last Updated: 23 July 2025
Static keyword is used for almost the same purpose in both C++ and Java. There are some differences though. This post covers similarities and differences of static keyword...
read more
C++
C++-Static Keyword
Static Keyword
Some interesting facts about static member functions in C++
Last Updated: 23 July 2025
1) static member functions do not have this pointer.For example following program fails in compilation with error "`this' is unavailable for static member functions "CPP ...
read more
C++
C++-Static Keyword
Static Keyword
Can Static Functions Be Virtual in C++?
Last Updated: 06 June 2022
In C++, a static member function of a class cannot be virtual. Virtual functions are invoked when you have a pointer or reference to an instance of a class. Static functio...
read more
C++
C++-Static Keyword
Static Keyword