Can I point out that if you really want portability with C++11, we do this and there is nothing your code can do with this as it uses the standard vector library
#include using namespace std;
#define YMAX 6
#define XMAX 4
// single line to define a 2D array of floats
vector> matrix1(YMAX, vector(XMAX));
// Now you can just set values
matrix1[0][0] = 3.6f;
matrix1[1][2] = 4.0f;
matrix1[5][3] = 8.0f;
// Or read them back
float f = matrix1[1][2];
The really cute part is it can be used on any standard type
// single line to define a 2D array of STRINGS
vector> stringmatrix(YMAX, vector(XMAX));
// writing strings in the array
stringmatrix[0][0] = "hello at 0,0";
stringmatrix[1][2] = "this one";
stringmatrix[5][3] = "hello at 5,3";
// Getting string value from the array
string whatdidwesay = stringmatrix[1][2];
In vino veritas