diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/binary-constants.html | |
new repository
Diffstat (limited to 'devdocs/gcc~13/binary-constants.html')
| -rw-r--r-- | devdocs/gcc~13/binary-constants.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/gcc~13/binary-constants.html b/devdocs/gcc~13/binary-constants.html new file mode 100644 index 00000000..90974191 --- /dev/null +++ b/devdocs/gcc~13/binary-constants.html @@ -0,0 +1,10 @@ +<div class="section-level-extent" id="Binary-constants"> <div class="nav-panel"> <p> Previous: <a href="thread-local" accesskey="p" rel="prev">Thread-Local Storage</a>, Up: <a href="c-extensions" accesskey="u" rel="up">Extensions to the C Language Family</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="Binary-Constants-using-the-0b-Prefix"><span>6.65 Binary Constants using the ‘<samp class="samp">0b</samp>’ Prefix<a class="copiable-link" href="#Binary-Constants-using-the-0b-Prefix"> ¶</a></span></h1> <p>Integer constants can be written as binary constants, consisting of a sequence of ‘<samp class="samp">0</samp>’ and ‘<samp class="samp">1</samp>’ digits, prefixed by ‘<samp class="samp">0b</samp>’ or ‘<samp class="samp">0B</samp>’. This is particularly useful in environments that operate a lot on the bit level (like microcontrollers). </p> <p>The following statements are identical: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">i = 42; +i = 0x2a; +i = 052; +i = 0b101010;</pre> +</div> <p>The type of these constants follows the same rules as for octal or hexadecimal integer constants, so suffixes like ‘<samp class="samp">L</samp>’ or ‘<samp class="samp">UL</samp>’ can be applied. </p> </div><div class="_attribution"> + <p class="_attribution-p"> + © Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br> + <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Binary-constants.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Binary-constants.html</a> + </p> +</div> |
