Flag (programming)
In
Flags may be found as members of a defined data structure, such as a database record, and the meaning of the value contained in a flag will generally be defined in relation to the data structure it is part of. In many cases, the binary value of a flag will be understood to represent one of several possible states or statuses. In other cases, the binary values may represent one or more attributes in a bit field, often related to abilities or permissions, such as "can be written to" or "can be deleted". However, there are many other possible meanings that can be assigned to flag values. One common use of flags is to mark or designate data structures for future processing.
Within
A command line switch is also referred to as a "flag". Command line programs often start with an option parser that translates command line switches into flags in the sense of this article.
See also
- Bit field
- Control register
- Enumerated type
- FLAGS register (computing)
- Program status word
- Semaphore (programming)
- Status register
References
- ISBN 978-0-08-050403-2. Retrieved 2023-07-31.
- ISBN 978-0-596-55532-0. Retrieved 2023-07-31.