Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Bitmasks

Programmatically, a bitmask refers to the representation of multiple switches and / or values by a single integer. Bitmasks are used primarily to conserve memory and / or disk storage, when compared to more traditional value storage mechanisms. Bitmasks are frequently employed in lower-level frameworks and a healthy knowledge and understanding of how they work as well as when to employ them, will only serve as beneficial.

Another benefit of working directly with binary are the availability of bitmask operations that are native to nearly every programming language in mainstream use today. These operations are highly efficient and provide powerful mechanisms to mathematically alter binary values, otherwise known as bit-twiddling.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial