Hi I'm intending to create and store a pointer (to store in GameBoard::m_panGameBoardArray) pointing to a 2d array (anBoard[][]). Send that pointer as an argument to function (in GameBoardRenderer) and print out (cout) the contents of the 2d array.
Sorry, Your method about passing 2D array can't work.
In your method, you pass a 2D array to a function with "void*" parameter. In this function you cast "void*" to "int*". in another function, you cast "int*" to "int**", then print this 2D array. I write some code to imitate your method, it is easy to see what's wrong.
1) You can't mix straight 2D arrays (int foo[x][y]) with dynamically allocated 2D arrays (int** bar), as the two are entirely different under the hood and cannot be interchanged.
2) Do not use void pointers as they mask illegal casts and let code compile without error, even though that code will explode when you try to run it.
3) You're having this trouble because multidimensional arrays are evil. See this thread:
In addition to explaining why they're evil, it also gives examples of proper syntax with using them. It also has alternative suggestions that are more sane.