0

I've been looking everywhere and I can't seem to find the correct syntax. This is what I have thus far.

int width;
int height;
int maxgrey;
int **dimensions;

//...read in height and width from file


dimensions = new int *[ width ][ height ];

1 Answers1

0
int width;
int height;
int **dimensions;

//...

dimensions = new int *[height];

for ( int i = 0; i < height; i++ ) dimensions[i] = new int[width];
Vlad from Moscow
  • 265,791
  • 20
  • 170
  • 303