3 ms·
Provided that: - you agree never to care about endianness (can probably get away with this now) - you don't want to represent anything complicated or
by pjc50 7mo ago
Provided that:
- you agree never to care about endianness (can probably get away with this now)
- you don't want to represent anything complicated or variable length, including strings
- codedokode 7mo agoYou can have strings by using relative pointers ("string starts 123 bytes before this").
- mgaunard 7mo agoYou can also just use an array which sets a max capacity, and either use a null-terminator or a separate size field. In practice you probably want to have both, and choose what's most practical based on the message.