title: how to initialize a static struct in c++?
body: <p>I have managed to initialize correct any variable of basic type(i.e. int, char, float etc) but when declaring a little complex variable all i can see is errors.</p>
  
  <p>In the header file timer.h i declare</p>
  
  <pre><code>class AndroidTimerConcept {
  ...
  private:
      //struct that holds the necessary info for every event
      struct Resources{
          timer_delegate_t membFunct;
          void *data;
          int size;
          millis_t time;
      };
      //declaring an array of 10 Resources structs
      static struct Resources ResData;
      static int best;
  ...
  }
  </code></pre>
  
  <p>inside the timer.cpp file</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "timer.h"
  using namespace std;
  
  
  int AndroidTimerModel::best=1000;
  struct Resources AndroidTimerModel::ResData.size; //line 17!!
  //constructor that initializes all the necessary variables
  
  AndroidTimerModel::AndroidTimerModel()
  {
      signal(SIGALRM,signalHandler);
  
      for(int i=0; i&lt;MAX_EVENTS; i++)
      {
          //ResData.data=NULL;
          ResData.size=-1;
          //ResData.time=-1;
      }
  
      best=1000;
  
  }
  </code></pre>
  
  <p>when compiling the .cpp file i get the error:
  timer.cpp:7: error: expected initializer before ‘.’ token</p>
  
  <p>Any suggestions would be really helpful.</p>
  
  <p>btw i use g++</p>