title: Read 2d array from txt file in c++
body: <p>This is my code</p>
  <pre><code>#include&lt;bits/stdc++.h&gt;
  using namespace std;
  
  int main()
  {
      char arr1[10][10];
      cout &lt;&lt; &quot;Reading Start&quot; &lt;&lt; endl;
      ifstream rfile(&quot;test.txt&quot;);
      rfile.getline(arr1[10], 10);
      int i, j;
      for (i = 0; i &lt; 6; i++)
      {
          for (j = 0; i &lt; 6; j++)
          {
              cout &lt;&lt; arr1[i][j];
          }
      }
      cout &lt;&lt; &quot;\nRead Done&quot; &lt;&lt; endl &lt;&lt; endl;
      rfile.close();
  }
  </code></pre>
  <p>This is my test.txt file</p>
  <pre><code>0 4 7 0 0 0
  4 0 0 5 3 0
  7 0 0 0 6 0
  0 5 3 0 0 2
  0 3 4 0 0 2
  0 0 0 2 2 0
  </code></pre>
  <p>I want to read this matrix but when using the above code then it shows core dumped output, can anyone give me a better solution to do this thing?</p>