Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In Chapter 6, we described two types of variables: automatic and static. Recall that if a local variable of a function is static, it exists between function calls. Similar to static variables, a class can have static members, functions, or variables. 

  • If a function of a class is static, in the class definition it is declared using the keyword static in its heading.

  • If a member variable of a class is static, it is declared using the keyword static,

  • A public static member, function, or variable of a class can be accessed using the class name and the scope resolution operator.

  • No labels