title: How can i print this 2d array?
body: <p>I want to create a 2nd array using a function; the user will enter the dimensions(x,y) and the function will print it; in the first row must appear the numbers 1,2,3...x and in the first column the characters a,b,c,d,e....y(y is given as a number).</p>
  
  <p>For example if the user enters x=5 y=7 it will print:</p>
  
  <pre><code>  1 2 3 4 5 
  a _ _ _ _ _
  b _ _ _ _ _
  c _ _ _ _ _
  d _ _ _ _ _
  f _ _ _ _ _
  h _ _ _ _ _
  i _ _ _ _ _
  </code></pre>
  
  <p>I wrote some code but I don't know how to do this with the letters.</p>
  
  <pre><code>void function(int x,int y)
  { 
      char th[x][y];
  
      for (int i = 1; i &lt; x; i++)
      { 
         for (int j = 1; j &lt; y; j++)
         {
            if(i==1 )
            {
              for (int k = 1; k &lt; x; k++)
              {
                 th[i][j]=k;
              }
            }
            else if(j==1)
            {
              th[i][j]='a';
            }
            else
            {
              th[i][j]='_';
            }
            std:: cout &lt;&lt; th[i][j] &lt;&lt;'\t';
         }
  
         cout &lt;&lt; std::endl;
      }  
   }
  </code></pre>