title: 2D arrays and Coordinates
body: <p>I'm trying to just print space in my "canvas" ( with coordinates (2,2) for example) by editing my 80x20 grid  made by █ blocks in the console window.</p>
  
  <ul>
  <li><p>Please suggest me better ways of creating the grid in the first place 
  ( I've just learned for-each loops)</p></li>
  <li><p>Why do I get those 3 characters after running the program ?</p></li>
  <li><p>Why isn't the space on the (2,2) block but obviously on the first row somewhere in the mid ?</p></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/eWZQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eWZQe.png" alt="enter image description here"></a></p>
  
  <p><strong>Code :</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
   uint8_t block {219}; // █
   uint8_t space {32};  // ' '
  
   uint8_t screen[80][20] {};
  
   for (auto &amp;row : screen)   // make the "canvas"
      for (auto &amp;col : row)
          col = block;
  
   for (int row = 1; row &lt;= 80; ++row)
   {
      for (int col = 1; col &lt;= 20; ++col)
      {
          if (col == 2 &amp;&amp; row == 2)
              screen[row][col] = space;
  
      }
   }
  
  
  std::cout &lt;&lt; *screen;
  
  return 0;
  }
  </code></pre>