I'm trying to initialize a class variable array. As I understand normal class variable initialization works like this:
class test
{
public:
static const float f;
};
However, as an array, it suddenly doesnt work:
class test
{
public:
static const float f[2];
};
//const float test::f = { 1 ,2};
The whole code should work, but I commented out the line 6. In line 4, it still threw
Error LNK2001 unresolved external symbol "public: static float const * const test::f"
I tried pointers and dynamic allocation, both of which didn't work either. How can I fix this error, and is there something wrong with line 6?