title: Two dimensional strings in C++
body: <p>I want to write something like 2d strings in C++. 
  I tried with :</p>
  
  <pre><code>vector&lt; vector&lt;string&gt; &gt; table;
          int m,n,i,j;
          string s;
          cin&gt;&gt;n&gt;&gt;m;
          for(i=0;i&lt;n;i++) {
                  for(j=0;j&lt;m;j++) {
                          cin&gt;&gt;s;
                          table[i][j] = s;
                  }
          }
          cout &lt;&lt; "\n\n\n\n";
          for(i=0;i&lt;n;i++) {
                  for(j=0;j&lt;m;j++) {
                          cout&lt;&lt;table[i][j]&lt;&lt;" ";
                  }
                  cout&lt;&lt;"\n";
          }
  </code></pre>
  
  <p>no compile errors, but when i enter input like:</p>
  
  <pre><code>10 20
  .....#..............
  .....#..............
  .....#..............
  .....#..............
  ######..............
  .......###..........
  .......#.#..........
  .......###...#######
  .............#.....#
  .............#######
  </code></pre>
  
  <p>It gives me segmentation fault. Why ? What's wrong ? And how it should be done so it would work correctly ? Thank you.</p>