Reading the file, and filling the array of structures
Hello,
i have created a structure holding pixel information, now i am going to make up a memory for the image, my program will read image from file, and then convert its data to the appropriate structure, and fill the array of such structures...
well...everything works just fine...i also made my program to print every value of colors etc in another statistical file...just for my information...
BUT... when my cycle was at the stage of 18682... it did not fill any structures into memory array... as you see from the pice of code below, the end variable in my primary for loop is 786432... but beginning from 18682 it did not write data anymore...
i decided to choose the more little picture... (this one was 1024 x 768), and it worked just fine!
but with this big picture it does such BUG...any ideas why?
as you see in my code, i included to inform me if there is no memory, but it didnt happen... so i wonder why it does not fill array of structures...
Code:
RGBQUAD *pixel = (RGBQUAD *)calloc(786432, 3);
if (pixel == NULL)
printf("No memory available!\n");
else
{
loading structures into memory
}