title: unable to display string array
body: <p>When i try to run this code, it compiles without any error, but i wanted that it should display the string and int array that it takes as input. Instead, after giving one input, I am presented with a list of zeroes and program terminates. 
  however,when i removed the line containing k[j] from both for loops, it worked.
  What am I doing wrong? Pardon if asked something stupid as I'm a novice, please help...</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  int main ()
  {
  int t,count = 0;
  string state[t];
  int k[t];
  cin&gt;&gt;t;
  for (int j=0; j&lt;t; j++)
  {
  getline(cin, state[j]);
  cin&gt;&gt;k[j];
  }
  for (int j=0; j&lt;t; j++)
  { cout&lt;&lt; state [j]&lt;&lt;'\t'&lt;&lt;k[j];
    cout&lt;&lt;endl;
  
  }
  return 0
  }
  </code></pre>