File: binary.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (11 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
In addition to hexadecimal hi(hexadecimal constant) integral constants
(starting with i(0x)), octal integral hi(octal constant) constants (starting
with i(0)), and decimal integral hi(decimal constant) constants (starting
with one of the digits 1..9), em(binary) integral hi(binary constant)
constants can be defined using the prefixes tt(0b)hi(0b, 0B) or
tt(0B). E.g., to represent the (decimal) value 5 the notation tt(0b101) can
also be used. 

The binary constants come in handy in the context of, e.g., i(bit-flags), as
it immediately shows which bit-fields are set, while other notations are less
informative.