下記にあるソースをコンパイルすると
error C2040: 'public: static int * A::b' : 'int' は 'int [10]' と間接操作のレベルが異なります。
というコンパイルエラーがでます
そこで、
int[10] A::b;
としてもエラーがでるので、どうやってstaticメンバ変数の実体を定義するのでしょうか?
#include <stdio.h>
class A
{
public:
static int a;
static int b[10];
};
int A::a = 0;
int A::b;
int main()
{
printf( "%d\n", A::a );
int i;
for( i=0; i<10; i++ )
printf( "%d\n", A::b );
return 0;
}