what is the static data member of class in C++ language with some features?steemCreated with Sketch.

in #computer7 years ago

Static- what is static data member?

Hello Guys, I am going to show you,what is the static data member of class in C++ language -A data

member that is shared among all objects of the class is known as static data member.

It may be defined as the static is a Keyword,it can be used to declare data variable function of the

class and object variable.Static variable will be allocated memory space once.Static data member

of class must initialize before main functions and after class.Static variable data member can be

said to every object of the same class number.Static member of class can be accessed directly

with their class name and with their object name.It works at run time, not like dynamic memory.

Features of Static Data Member--

Static is a Keyword.
It is used to declare data variable function variable of the class and object variable.
Static variable will allocate memory space once and fast bracket for most bracket
Static data member of class must be initialized before main functions and after class.
Static variable member can be said to every object of the same class number.
Static member of class can be accessed directly with their class name and with their object name.
Non static data member of class cannot be directly used inside the static member functions of class.

static data member

Some other features of static data member-

Static data member of class is also known as active member and none instance member.
Non static data member of class is also known as inactive member of class and instance static member functions of class .
Static data member of class can be directly used inside static member functions of classs
Non static data member of class cannot be directly used inside static member of class.

Coin Marketplace

STEEM 0.15
TRX 0.15
JST 0.028
BTC 53949.09
ETH 2223.84
USDT 1.00
SBD 2.31