J
Jay
I'm trying to store a sequence of operations and values of different types into a single array. It's
a sequence of command word bytes, and a sequence of one or more values (as determined by the command
word) which might be int or double or char (again defined by the command word).
For example, a command byte "MULDBL" would be followed by 2 doubles (each 8 bytes each). This might
be followed by the command byte STRING would be followed by a byte (indicating the length of the
string) and them by some chars.
MULDBL, STRING, and many other command bytes would be part of an enum.
I can do this in C by storing everything in a char array, and using pointers and casts to write the
data into the array, and later read it from the array. How would I do this in C#?
a sequence of command word bytes, and a sequence of one or more values (as determined by the command
word) which might be int or double or char (again defined by the command word).
For example, a command byte "MULDBL" would be followed by 2 doubles (each 8 bytes each). This might
be followed by the command byte STRING would be followed by a byte (indicating the length of the
string) and them by some chars.
MULDBL, STRING, and many other command bytes would be part of an enum.
I can do this in C by storing everything in a char array, and using pointers and casts to write the
data into the array, and later read it from the array. How would I do this in C#?