Advertisement

Help with the & bit operator and hex

Started by June 04, 2001 02:50 PM
9 comments, last by the_grip 23 years, 8 months ago
Hex values are used because of the way they correlate with memory. As Fredrik pointed out, one hex digit is a nibble, and thus 2 hex digits occupy exactly one byte of memory. And so on. With decimal values, however, the value must be stored in a "rounded out" variable, meaning it must be converted to hex or binary. You can do it with a decimal value, as your compiler will quickly prove, but it''s less memory efficient though not significantly.

There are other reasons I can''t quite remember right now; someone will probably post to explain them as well.

This topic is closed to new replies.

Advertisement