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:
anyway, when i try to compile, i get errors about the array being undefined... but i clearly define it using: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, this is the first time i get an error like this :S, thanks in advance for any helpCode:DWORD dwLetter[iHeight][iWidth]; iHeight and iWidth are calculated before defining the array... I also tried: DWORD *dwLetter = new DWORD[iHeight][iWidth];



LinkBack URL
About LinkBacks



Any tips? Did I mess up the declaring of the array?