Re: Parsing through data...
depends on the structure and how the sender put the package together. Is the buffer you received a complete immage of the structure? If yes, and the structure does not contain any c++ class objects (like std::string) then just memcpy the buffer into the structure.
Re: Parsing through data...
The buffer is a complete image once all the data has been collected but I also need to verify this. The only types that are in the packet are bool, int and float and a few strings (no objects).
Im not exactly sure how Im going to tell the difference between many packets coming in and when they start / end.... They have a start and end charateur and the packets a fixed length so shouldnt be difficult.
Thanks Stober.
Re: Parsing through data...
Another problem you might encounter is Endian order if the data is transferred from one type of computer to another, such as between MS-Windows and IBM AIX unix.
Re: Parsing through data...
Yes, before memcpy'ing make sure byte ordering in the stream allows you to.
Re: Parsing through data...
Both sides are little endian.
Thanks people.