mirror of
https://github.com/irmen/prog8.git
synced 2025-08-03 23:27:04 +00:00
added offsetof() to get the byte offset of struct members.
This commit is contained in:
@@ -843,6 +843,11 @@ sizeof(name)
|
||||
For an 10 element array of floats, it is 50 (on the C-64, where a float is 5 bytes).
|
||||
Note: usually you will be interested in the number of elements in an array, use len() for that.
|
||||
|
||||
offsetof(membername)
|
||||
Number of bytes from the start of a struct variable that this member variable is located.
|
||||
For now, this only works on members of a declared struct variable and not yet on members
|
||||
referenced from the struct type itself. This might be improved in a future version of the language.
|
||||
|
||||
swap(x, y)
|
||||
Swap the values of numerical variables (or memory locations) x and y in a fast way.
|
||||
|
||||
|
Reference in New Issue
Block a user