Other uses Static (keyword)
1 other uses
1.1 static global variable
1.2 static local variables
1.3 static member variables
1.4 static function
1.5 static method
other uses
the static keyword when prefixed while declaring variable or function can have other effects depending on declaration occurs.
static global variable
a variable declared static @ top level of source file (outside function definitions) visible throughout file ( file scope , known internal linkage ). in usage, keyword static known access specifier .
static local variables
variables declared static inside function statically allocated, keep memory cell throughout program execution, while having same scope of visibility automatic local variables (auto , register), meaning remain local function. hence whatever values function puts static local variables during 1 call still present when function called again.
static member variables
in c++, member variables declared static inside class definitions class variables (shared between class instances, opposed instance variables).
static function
similarly, static function -- function declared static @ top level of source file (outside class definitions) -- visible throughout file ( file scope , known internal linkage ).
static method
similarly, static method -- method declared static inside class definition -- meant relevant instances of class rather specific instance.
Comments
Post a Comment