I have a class with a const static C-array in it
// Header file
class test
{
const static char array[];
};
I am trying to initialize it somewhere in the code but not in the straight-forward way like
// Source file
const char test::array[] = {'1','2','3'};
because the values are calculated using some other constant values so i need to use a function to do that. something like
CONST_VALUE = 4;
void func(int a[3]){
a[0]=2*CONST_VALUE;
a[1]=10*CONST_VALUE;
...
}
The point is that i don't know where to define and use such a function, should it be a member function? a global function? and when should i call it so it happens only once?