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/empty-structures.html | |
new repository
Diffstat (limited to 'devdocs/gcc~13/empty-structures.html')
| -rw-r--r-- | devdocs/gcc~13/empty-structures.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/devdocs/gcc~13/empty-structures.html b/devdocs/gcc~13/empty-structures.html new file mode 100644 index 00000000..2f702560 --- /dev/null +++ b/devdocs/gcc~13/empty-structures.html @@ -0,0 +1,8 @@ +<div class="section-level-extent" id="Empty-Structures"> <div class="nav-panel"> <p> Next: <a href="variable-length" accesskey="n" rel="next">Arrays of Variable Length</a>, Previous: <a href="zero-length" accesskey="p" rel="prev">Arrays of Length Zero</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="Structures-with-No-Members"><span>6.19 Structures with No Members<a class="copiable-link" href="#Structures-with-No-Members"> ΒΆ</a></span></h1> <p>GCC permits a C structure to have no members: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">struct empty { +};</pre> +</div> <p>The structure has size zero. In C++, empty structures are part of the language. G++ treats empty structures as if they had a single member of type <code class="code">char</code>. </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/Empty-Structures.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Empty-Structures.html</a> + </p> +</div> |
