title: Can I initialize static float Variable during runtime?
body: <p>I need to set the value of static float variable during run time but I am unable to do that.
  I will provide example to elaborate my situation</p>
  
  <p>afile.h</p>
  
  <pre><code>class B {
      static float variable1;
      static float variable2;
   public:
      afunction(float a, float b);
  } 
  </code></pre>
  
  <p>afile.cpp</p>
  
  <pre><code>#include 'afile.h'
  B::afunction (float a, float b) {
      float B:variable1 = a;
      float B:variable2 = b;
  } 
  </code></pre>
  
  <p>As you see in the code above the function 'afunction' is called and then the variables 'variable1' and 'variable2' has to be set. I know the code in definition of 'afunction' is wrong however I need a way to set value of variable1 and variable2 during run time.</p>
  
  <p>If it is relevant to my code, I am using Visual Studio 6.0 to develop the application</p>