How to set variable padding bytes? #1764
Answered
by
paxcut
xlbao123
asked this question in
Pattern Language Q&A
-
For example, I have such struct:
how to make this work? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
paxcut
Jun 17, 2024
Replies: 1 comment 4 replies
-
padding is a built in type measured in bytes so just struct chunk_t {
u32 size;
.... //others
padding[size - size of others];
}; |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your welcome. The current file offset (aka as the cursor offset) is denoted by the symbol
$
which is readable and write-able.so