○static変数とstatic関数の作成 #include <stdio.h> class test{ public: static int i; static int get(); }; int test::i;//static変数は定義の必要あり int test::get(){ return i; } int main(){ test::i=10; printf("%d\n",test::get()); return 0; }