From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/CPLUSPLUS/SYNTAX/static.htm | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 reference/CPLUSPLUS/SYNTAX/static.htm (limited to 'reference/CPLUSPLUS/SYNTAX/static.htm') diff --git a/reference/CPLUSPLUS/SYNTAX/static.htm b/reference/CPLUSPLUS/SYNTAX/static.htm new file mode 100644 index 0000000..a3be440 --- /dev/null +++ b/reference/CPLUSPLUS/SYNTAX/static.htm @@ -0,0 +1,89 @@ + + +static keyword + + + + +
+

static keyword

+
+

+The static keyword has been extended in C++ to have the +following meanings. +

+ + + + + + + + + + + + + + + + + + + + +
C++ ContextAction
+A variable outside of a function. + +Variable can be seen by all functions in the file. Default. +
+Variable inside a function. + +The variable is permanent. The variable can only be initalised +once and only one copy of the variable exists. Recursive calls +use the same variable. +
+A class member variable + +Only one copy of the variable exists. All instances of the object +use the same variable (memory location). +
+A class member function (method). + +Function can only access static members of the class +
+

+ +


+Here is the way static works in C +
+

See Also:

+
+ +
+ +

C References

+

+ +


+

+

+ + + + +
+Top + +Master Index + +C++ Keywords + +Functions +
+
+

+ +


+
Martin Leslie +08-Dec-96
-- cgit v1.2.3-54-g00ecf