Hello all!
Using C/C++ I can do this:
struct MyStruct
{
int a;
char b;
};
MyStruct test;
fread(&test,siz eof(MyStruct),1 ,fp);
How can a do this in C#? I found a Stream class,maybe I can use
System::Read(by te[] buffer,int offset,int count)? I can get sizeof a struct,
but how to convert a struct object to byte[]??
thanks.
Using C/C++ I can do this:
struct MyStruct
{
int a;
char b;
};
MyStruct test;
fread(&test,siz eof(MyStruct),1 ,fp);
How can a do this in C#? I found a Stream class,maybe I can use
System::Read(by te[] buffer,int offset,int count)? I can get sizeof a struct,
but how to convert a struct object to byte[]??
thanks.
Comment