Its a very simple class atm, and i plan to expand on it later, but currently i know that the get height and getWidth functions being called work. And all the code above works properly, however the fault comes when i try to make the array into a 2D array:
m_pBitmapGrid = new Bitmap*[m_iTilesAcross][m_iTilesDown];
i get the following compile errors related to the line above:
error C2540: non-constant expression as array bound
error C2440: '=' : cannot convert from 'Bitmap *(*)[1]' to 'Bitmap **'
the two variables that define the size of the array are of the same type and are set to a specific value in the constructor. Even when i made the 2nd dimention of the array [m_iTilesDown] it still didnt compile and gave me the same errors.
But i know that m_iTilesAcross should count as a constant integer becuase it works fine when initializeing just a 1 dimensional array. So why is it that a single dimention array works and a 2d array dosnt. And is there any way around this?
Bookmarks