I'm working on converting an old C program (currently run on UNIX) into our C# system.
The program builds some data into several structs and then writes a file using a series of fwrites like this:
fwrite ( &loc, sizeof ( struct loc_items ), 1, hdata.fp );
With loc being the data, struct loc_items being the struct it's a type of.
My question is if I will be able to match this file output with C#? Assuming I can match the endian format and sizes of floats, ints, etc.
Since it's writing the entire struct in the fwrite, I don't know the order that it's writing the different variables of the struct. Also is there any issue with padding around the struct the fwrite might put?
Any advice?