3 ms·
They're perfectly usable between different architectures, languages, operating systems and compilers, if precautions are taken. I did this many moons ago betwee
by squarefoot 9y ago
They're perfectly usable between different architectures, languages, operating systems and compilers, if precautions are taken. I did this many moons ago between big and little endian machines both in C for various Unixes and Delphi under Windows to exchange data in a network. Of course we used ntoh() and hton() functions extensively, #pragmas to adapt data alignment and similar features under Delphi.
The use of unions allowed us to use a single buffer for each packet received going to the relevant part after matching the header which described what was being sent. All worked perfectly for years on SCO/Unix, IBM AIX, Linux and Windows.