I am doing an online course and for one of the chapters (in Practical C++ Programming by Steve Oualline) it had a bitmapped graphics section-only 4 pages long. The chapter is about bit operations and includes a section about hexadecimals. I understoodit until I got to this passage in bitmapped graphics:
"Suppose we have a small graphics devicce- a 16 by 16 pixel monochrome display. We want to set a bit at 4,7. But we have a problem. There is no data type for an array of bits in C++. The closest we can come is an array of bytes. Our 16 by 16 array of bits now becomes a 2 by 16 array of bytes. [[I]Why isn't it a 2 by 2 array?[/I]] To set the pixel at bit number 4,7 we need to set the fourth bit of byte (0,7). To set this bit we would use the statement bit_array[0][7] |= (0x80>>(4));"
What was the |= in the statement and I am also in need of a step by step explanation of the bit_array[0][7] |= (0x80>>(4)); statement (dont tell me it was explained above-it didnt make sense to me). Also, how would you output a simple 8 bit by 8 bit graphics that has 1 pixel turned on the rest off(because the book has no explanation of how to output that to the console)?
Thank You for your help.