It's also possible to use a single dimensional array or vector and mimic a 2D array or vector like this:
v[y * order + x]
That way you can allocate it as a 1D array or order*order size....
Type: Posts; User: oogabooga
It's also possible to use a single dimensional array or vector and mimic a 2D array or vector like this:
v[y * order + x]
That way you can allocate it as a 1D array or order*order size....
You're creating the 2D array properly, but you're calling and declaring your subroutines wrong:
MagicSquare(ptr, order);
...
void MagicSquare(int **ptr, int n)
// same for display func
...