Bitwise Operators

Publication: C++ Builder Developer's Journal
Issue: Volume 7, Number 4, April 2003

This is a follow on article to ‘Safe File Operations’ where we were first introduced to bitwise operators in retrieving file attributes. In this article I discuss in further detail the theory behind bitwise operators and their use in the Windows API and VCL.

In this month’s article on Safe File Operations, I showed a technique to determine if a file was read only. What may not be readily understood is that I used Bitwise operators and manipulation to determine if the Read Only attribute was set. This article will revisit some of the code from the previous article, and provide detailed explanations on Bitwise operators and their use in the Windows API and VCL.