Using Bit fields
Posted on 2002-03-12
I m back again with a another query , before that i must say God bless the team who thought of this site, has helped me a lot during my studies, i m contributing my bit by recomending it to my friends.
Getting back to my query, i want to create a mask for a p'cular color in an image , now i create this mask by creating a char array of the iamge size and using it for storing 1s for the corresponding color and 0s otherwise. This is not a problem , the problem is that just to store 1 bit data i m using 8bits(byte of a char) , i was suggested to use bit fields but then i cannot create an array of bitfield structure and since the image size varies i cannot predefine it. Please help