title: Definition of variables into arrays and proper syntax
body: <p>I have a code here:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  int main()
  {
      int a, b=0,d,f=1;
      string c, e, g;
  
      cout&lt;&lt;":"&lt;&lt;endl;
      cin&gt;&gt;a;
      string question[a];
      for(;b&lt;a;b++)
      {
          cout&lt;&lt;"#"&lt;&lt;b+1&lt;&lt;":"&lt;&lt;endl;
          getline(cin,c);
          question[b]=c;
          cout&lt;&lt;":"&lt;&lt;endl;
          cin&gt;&gt;d;
          getline(cin,e);
          question[b][d+1]{e};
          for(;f&lt;d;f++)
          {
              cout&lt;&lt;" #"&lt;&lt;f&lt;&lt;":"&lt;&lt;endl;
              getline(cin,g);
              question[b][f]=g;
          }
      }
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>This does not compile and I believe it is because the variables -that I want to define the first availabe spaces in arrays as- are seen as characters and not their values that would be defined by the user input. I'm trying to get my bearings on C++ right now; could somebody explain to me in simple terms why this does not work and how I should fix my problem?</p>
  
  <p>Error:</p>
  
  <pre><code>Error   1   expected constant expression    12
  Error   2   cannot allocate an array of constant size 0 12
  Error   3   'question' : unknown size   12
  Error   4   syntax error : missing ';' before '{'   21
  Error   5   syntax error : missing ';' before '}'   21
  Error   6   '=' : cannot convert from 'std::string' to 'char'   27
  Error   7   IntelliSense: expression must have a constant value 12
  Error   8   IntelliSense: expected a ';'    21  19
  </code></pre>