title: Can you initialize a static array with a function?
body: <p>I have a class with a const static <strong>C-array</strong> in it</p>
  
  <pre><code>// Header file
  class test
  {
      const static char array[];
  };
  </code></pre>
  
  <p>I am trying to initialize it somewhere in the code but not in the straight-forward way like </p>
  
  <pre><code>// Source file
  const char test::array[] = {'1','2','3'};
  </code></pre>
  
  <p>because the values are calculated using some other constant values so i need to use a function to do that.
  something like</p>
  
  <pre><code>CONST_VALUE = 4;
  void func(int a[3]){
      a[0]=2*CONST_VALUE;
      a[1]=10*CONST_VALUE;
    ...
  }
  </code></pre>
  
  <p>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?</p>