mirror of
https://github.com/irmen/prog8.git
synced 2026-04-21 17:16:33 +00:00
doc and opening borders
This commit is contained in:
@@ -132,7 +132,7 @@ dealing with all of them separately. You first define the struct type like so::
|
||||
You can use boolean fields, numeric fields (byte, word, float), and pointer fields (including str, which is translated into ^^ubyte).
|
||||
You cannot nest struct types nor put arrays in them as a field.
|
||||
Fields in a struct are 'packed' (meaning the values are placed back-to-back in memory), and placed in memory in order of declaration. This guarantees exact size and place of the fields.
|
||||
``sizeof()`` knows how to calculate the size of a struct.
|
||||
``sizeof()`` knows how to calculate the combined size of a struct, and ``offsetof()`` can be used to get the byte offset of a given field in the struct.
|
||||
The size of a struct cannot exceed 1 memory page (256 bytes).
|
||||
|
||||
You can copy the whole contents of a struct to another one by assigning the dereferenced pointers::
|
||||
|
||||
Reference in New Issue
Block a user