Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.7K+ articles
C++
3.8K+ articles
Difference Between
3.2K+ articles
C++ Programs
1.5K+ articles
cpp-class
58+ articles
Functions
57+ 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
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
Memory Allocation in Static Data Members in C++
Last Updated: 14 June 2020
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
Difference between Static and Friend Function in C++
Last Updated: 28 December 2022
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
Difference between static and constant function in C++
Last Updated: 04 May 2021
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
Static Member Function in C++
Last Updated: 20 December 2022
The static keyword is used with a variable to make the memory of the variable static once a static variable is declared its memory can't be changed. To know more about sta...
read more
Technical Scripter
C++
Picked
Technical Scripter 2022
C++-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
Some interesting facts about static member functions in C++
Last Updated: 30 October 2020
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
Comparison of static keyword in C++ and Java
Last Updated: 05 September 2023
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
Static Objects in C++
Last Updated: 14 March 2023
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
How to Declare a Static Variable in a Class in C++?
Last Updated: 15 February 2024
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
How to Declare a Static Data Member in a Class in C++?
Last Updated: 22 February 2024
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 Member Function in a Class in C++?
Last Updated: 27 February 2024
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
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !