Having a problem setting user input to a dynamic array. It worked with a static array, but now I'm having some kind of pointer issue. The user sets the dimensions and enters in a number of characters, which should be set to the array 'gameboard'. it's just setting jibberish though. Any help or advice would be great. Thanks in advance.
char **gameboard = NULL;
gameboard = new char*[dimen];
for (int row = 0; row < dimen; row++)
{
gameboard[row] = new char[dimen];
}
for (int n = 0; n < (dimen * dimen); n++)
{
*((char*)gameboard +n) = tolower( (cin >> ws).get() );
}