--also--

Speaking of 2-d arrays on the last topic, does anyone know a simple way to create a dynamic 2-d array?

ha ha ha ha ha ha

Here’s a piece of code to create a 20x30 array dynamically.

char **dynamic2DArray;
dynamic2DArray = new char *[20];
for(int i = 0; i < 20; ++i)
{
dynamic2DArray[i] = new char[30];
}

You access it as dynamic2DArray[x][y], where x is between 0 and 19, and y between 0 and 29.

Thanks Bob. That is very useful information.