How can I convert the following java function into C++?
<p>If I have the following Java code:</p>

<pre><code>int[][] readAPuzzle()
{
    Scanner input = new Scanner(System.in);

    int[][] grid = new int[9][9];
    for (int i=0; i&lt;9; i++)
      for (int j=0; j&lt;9; j++)
        grid[i][j] = input.nextInt();

    return grid;
}

public static void main(String[] args) {
    // Read a Sudoku puzzle
    int[][] grid = readAPuzzle();
}
</code></pre>

<p>How can I convert this to C++? I get hung up on passing the array.  Here is my attempt:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

const int puzzle_width = 9;
const int puzzle_height = 9;

void readAPuzzle(int (&amp;grid)[puzzle_height][puzzle_width])
{
    for(int i = 0; i &lt; 9; i++)
        for(int j = 0; j &lt; 9; j++)
            grid[i][j] = cin &gt;&gt; grid[i][j];

    return;
}

int main()
{
    int[9][9] grid;
    readAPuzzle(grid);
}
</code></pre>

<p>What am I doing wrong in general?  </p>
