title: C++ data member initializer is not allowed
body: <p>I totally new to C++ so bear with me. I want to make a class with a static array, and access to this array from the main. Here is what i want to do in C#.</p>
  
  <pre><code>   namespace ConsoleApplication1
      {
          class Program
          {
              static void Main(string[] args)
              {
                  Class a = new Class();
                  Console.WriteLine(a.arr[1]);
  
              }
          }
      }
  
      =====================
  
      namespace ConsoleApplication1
      {
          class Class
          {       
              public static string[] s_strHands = new string[]{"one","two","three"};
          }
      }
  </code></pre>
  
  <p>Here is what i have tried:</p>
  
  <pre><code>// justfoolin.cpp : Defines the entry point for the console application.
  //
  
  #include "stdafx.h"
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  class Class {
  
    public:
        static string arr[3] = {"one", "two", "three"};
  };
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      Class x;
      cout &lt;&lt; x.arr[2] &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>But i got:
  IntelliSense: data member initializer is not allowed</p>