#include <iostream> using namespace std; class StaticMemberClass { static int i; public: static void init(int x) { i = x; } void show() { cout << i; } }; int StaticMemberClass::i; // define i int main() { StaticMemberClass::init(100); StaticMemberClass x; x.show(); return 0; }