Surely I can't use sizeof(message) though...
That's going to be 4 bytes wihch is wrong as the message could be up to 300 bytes long...
Surely I can't use sizeof(message) though...
That's going to be 4 bytes wihch is wrong as the message could be up to 300 bytes long...
The way it stands I have little choice as the program I'm communicating with is already made and cannot be changed.
I need to send one buffer in the form:
[<- 12 bytes of header->][<- variable length up to 64 bytes - of options->][-< variable length up to 300 bytes - of message->]
There's no way to change that.
I doubt sending the sizeof(options) (= 64) is a good plan, because it will expect 64 bytes of options probably. Most of the time only the first 2 elements of the array are set.
Can you explain what you mean please?
Thanks.
Actually, I think I will make it so that the message is no longer passed in as an argument and I could just get the message inside the function and that way, both options and message will be local arrays inside the function and I will be able to sue sizeof without any problems.