1
Answer

How to convert an unmanaged structure pointer to byte[] in c

shine pb

shine pb

11y
1.5k
1
Please help me to convert an unmanaged structure pointer to byte[] in c#?

public struct struct1
{
    public byte a;
    public int b;
}

struct1 objstruct= new struct1();
struct1* ptrStruct=&objstruct;
ptrStruct->a=1;
ptrStruct->b=4;

how can i convert ptrStruct to byte[]?
Answers (1)