title: Boolean 2D array initialization error C++
body: <p>This program is suppose to take a <code>size</code> amount of pairs of numbers which are coordinates within a 2D boolean array. Every coordinate triggered switches the value to <code>TRUE</code>. For some reason I am having errors in the last row as well as the last space in the last row. Any ideas?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  
  int main(){
      const int size = 10;
      int *x = new int [size];
      int *y = new int [size];
      bool table[size][size] =  {{false}};
      for(int i = 1 ; i &lt;= size; i++){
          cin &gt;&gt; x[i] &gt;&gt; y[i];
          if(x[i] &lt;= size &amp;&amp; y[i] &lt;= size){
              table[x[i]][y[i]] = true;
          } else{
              cout &lt;&lt; "invalid input \n";
              i--;
          }
      }
  
  
      for(int a = 1; a &lt;= size; a++){
          for(int b= 1; b &lt;= size; b++){
              cout &lt;&lt; table[a][b] &lt;&lt; " ";
          }
          cout &lt;&lt; "\n";
      }
      return 0;
  }
  </code></pre>