Skip to content

Commit

Permalink
Size fo empty structs in C is zero byte.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 committed Mar 13, 2020
1 parent e2f11fe commit 091a595
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/type-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ the sake of clarity. To perform memory layout computations in actual code, use

</div>

> Note: This algorithm can produce zero-sized structs. This differs from
> C where structs without data still have a size of one byte.
> Note: This algorithm can produce zero-sized structs. In C, the size of
> structs without data is zero. This is not the same as C++ where structs
> without data still have a size of one byte.
#### \#[repr(C)] Unions

Expand Down

0 comments on commit 091a595

Please sign in to comment.