title: Printing a grid
body: <p>I want to print a game board grid which will vary in size depending on what the user inputs. I also wanted to know would it be best or even be possible to make this same grid using an array or would I need some type of 2d array of some sort?</p>
  
  <pre><code>void printGrid(int &amp;userRows, int &amp;userColumns){
    cout &lt;&lt; "Enter the number of rows -&gt; ";
    cin &gt;&gt; userRows;
    cout &lt;&lt; "Enter the number of columns -&gt; ";
    cin &gt;&gt; userColumns;
  
    for(int i = 0; i &lt; userColumns; i++){
      cout &lt;&lt; "|";
  
      for(int y = 0; y &lt; userRows; y++){
        cout &lt;&lt; "-";
      }
    }
  }
  </code></pre>
  
  <p>I got the nested loop part down pat. Just having an issue telling it to print a new line and to spawn one after the other. Thank you
  <a href="https://i.stack.imgur.com/ormAe.png" rel="nofollow noreferrer">Here is the final product I am going for</a></p>