how to use dynamic arrays?
lets say i wanna do a matrix:
WORD Map[x][y]
how can i allocate this dynamic array with still
refering to it as a matrix?
10x,
Gil
WORD **Map;Map = new (char *)[x];for(int j = 0; j < x; ++j) Map[j] = new char[y];
You can now access any element Map[j][k] (j < x and k < y).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement