[prev] 81 [next]

Structures (cont)

Possible memory layout produced for TicketT object:

---------------------------------
| D | S | A | 4 | 2 | X | \0|   |    7 bytes + 1 unused ("padding")
---------------------------------
|                          68.4 |    8 bytes
---------------------------------
|             2 |             6 |    8 bytes
---------------------------------
|            20 |            45 |    8 bytes
---------------------------------

 

Note: padding is automatically added to ensure that speed starts at a memory address divisible by 8 (because it's an 8-byte data type).

Don't normally care about internal layout, since fields are accessed by their name.