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.18
TRX 0.24
JST 0.036
BTC 94781.20
ETH 3263.66
USDT 1.00
SBD 3.08