Static keyword can be used in the following situations:
* static global variable
* static function
* static local variable
* static member variable (class variable)
* static method
* static object
```
#include <iostream>
using namespace std;
static int sgv = 1;
static void sf() {
static int slv = 2;
cout << ++slv <<",";
}
class C {
public:
static int smv;
static void print() {
cout << smv << endl;
}
};
int C::smv = 1;
int main()
{
cout << sgv << endl;
for (int i = 0; i < 5; i++)
sf();
cout << endl;
{
C c1, c2;
cout << c1.smv << ", " << c2.smv << endl;
static C c3;
c3.print();
}
C::print();
return 0;
}
```