Hey,
Well i was just working on an algorithm to read in a monochrome bitmap and then save each pixel to a two dimensional array, the code for loading into the array is below:
Code:
BYTE *dibLetter = LoadDib(sPath);
iWidth = DibWidth(dibLetter);
iHeight = DibHeight(dibLetter);
DWORD dwLetter[iHeight][iWidth];
if (dibLetter)
{
memset(&dwLetter, 0, iHeight * iWidth);
for (int i = 0; i < iWidth; i++)
{
for (int j = 0; j < iHeight; j++)
{
dwLetter[j][i] = DibGetPixel(dibLetter, j, i);
}
}
free(dibLetter);
dibLetter = NULL;
}
anyway, when i try to compile, i get errors about the array being undefined... but i clearly define it using:
Code:
DWORD dwLetter[iHeight][iWidth];
iHeight and iWidth are calculated before defining the array...
I also tried:
DWORD *dwLetter = new DWORD[iHeight][iWidth];
Anyway, this is the first time i get an error like this :S, thanks in advance for any help