class Foo
{
public:
static const unsigned int Bar[] = {0x55c636e2, 0x02be0170, 0x584b71d4};
};
Pre-defined arrays help!
I have this declaration of a variable that has its values defined in a header that fails to compile. Do you know how to make this work?
You need to intialize the array outside the class declaration. ex:
class Foo{public: static const unsigned int Bar[];};// in a source file somewhere:const unsigned int Foo::Bar[] = {0x55c636e2, 0x02be0170, 0x584b71d4};
i _think_ that will only work for standard ints/floats;
for what your doing, IIRC,
.h
class C{
static const int array[3]
}
.cpp
const int C::array[3] = {...};
it compiled ( i didnt test ) on my machine...
for what your doing, IIRC,
.h
class C{
static const int array[3]
}
.cpp
const int C::array[3] = {...};
it compiled ( i didnt test ) on my machine...
Quote:Original post by rip-off
i _think_ that will only work for standard ints/floats;
Not even floats. Just integral types.
CM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement