hi,
this is what i would like to do:
but i am not allowed to...PHP Code://test.h
class test
{
static const int test::arr[5] = {1,2,3,4,5};
}
Instead i have to initialize the array separately
PHP Code://test.h
class test
{
static const int arr[5];
}
//test.cpp
const int test::arr[5] = {1,2,3,4,5};
Out of interest, why?
The first version seem a lot more intuitive to me; and all the code & data is nicely in one place.
Does the actual way yield any advantage i dont see right away?
just wondering...




Reply With Quote