I just want to convert a piece of PHP code to C# so I need it's equivalent.
And what does unpack really do? I'm very interested in this function.
I just want to convert a piece of PHP code to C# so I need it's equivalent.
And what does unpack really do? I'm very interested in this function.
Unpack reads the binary data according to the data type you tell it to parse as and returns the values in an array.
The closest thing I can think to this would be to a struct
within C(++) / C#, where it populates the struct
's members with information from the binary data. A struct within C style languages is like an object, but without methods.
I can't think of any good examples right now on how to read data into a struct, but that's because I'm not really very good at C or C++ or C# for that matter. Try looking at this for examples on how to read data into structs ... or as always ... google it.