title: How can I create an array inside a function then use this array to create another array?
body: <p>I'm a newbie in C++, I was learning to code in python.
  I believe the solution is simple but I have no idea how to do it.</p>
  
  <p>Here is what I was trying to do in C++ (not working):</p>
  
  <pre class="lang-cpp prettyprint-override"><code>int createBoard(int x, int y) {
      int l[x];
      int board[y, l[x]];
      return board;
  }
  int main() {
      int x = 5;
      int y = 6;
      board = createBoard(x,y);
      return 0;
  }
  </code></pre>
  
  <p>Here is what I wanted to replicate (working, but in python):</p>
  
  <pre class="lang-py prettyprint-override"><code>def createBoard(x,y):
      length = [i for i in range(0,10)]
      area = [y,length]
      return area
  
  area = createBoard(5,6)
  </code></pre>
  
  <p>Basically I want to create a function that returns an array with the y value and an array counting until x.</p>