S
Slain
I have a buffer, which has a header and then data. There is some
leeway space between the header and the data in the buffer.
I have to add some more data which is a struct and I know the size of
it. So if I get a pointer to the beginning of the start of data, go
back the size of my struct, can I just put the address of my struct ?
Packet A -- Header + Data
Struct B --> size X bytes
Pointer_to_Data
Pointer_to_Data = Pointer_to_Data - X
Is it recommended to copy the struct or can I just pass the address of
my sturct variable. If so how?
Thanks
leeway space between the header and the data in the buffer.
I have to add some more data which is a struct and I know the size of
it. So if I get a pointer to the beginning of the start of data, go
back the size of my struct, can I just put the address of my struct ?
Packet A -- Header + Data
Struct B --> size X bytes
Pointer_to_Data
Pointer_to_Data = Pointer_to_Data - X
Is it recommended to copy the struct or can I just pass the address of
my sturct variable. If so how?
Thanks