Conversation

Question for the C heads here. Is there a more elegant approach to parsing and creating messages of a specific format without doing a bunch of super error prone math / manual byte fiddling in an array? /1
5
1
Replying to
Should be able to cast to struct pointers to simplify. Just make sure C stores your struct in memory as you expect. You can also switch on message type to handle specific message types, cast further, etc. If I understand the problem correctly.
1
Replying to
"make sure C stores your struct in memory as you expect" is where my issue is. Is that possible at all? The internet seems to say no when I google about
1
Replying to and
I've stumbled upon this right now. I feel a bit uneasy about it as that seems non-standard and I have no control over the compiler being used by the user. Having it portable would be important.
2