#include <iostream>
using namespace std;
class T
{
private:
static bool a[5][5];
public:
void show()
{
cout<<a[0][0]<<endl;
}
};
bool T::a[5][5]={true};
int main()
{
T t;
t.show();
return 0;
}
如果是const static int/enum 标准充许可以直接在类中初始化.
using namespace std;
class T
{
private:
static bool a[5][5];
public:
void show()
{
cout<<a[0][0]<<endl;
}
};
bool T::a[5][5]={true};
int main()
{
T t;
t.show();
return 0;
}
如果是const static int/enum 标准充许可以直接在类中初始化.