Hi Ali,
You can probably try to simulate the equivalent of an union
by setting the [FieldOffset] attribute for all members
in a struct to the 0th position for the offset.
[StructLayout(LayoutKind.Explicit)]
public struct MyUnionWithCategories
{
[FieldOffset(0)] public int Category;
[FieldOffset(0)] public char CategoryRep;
[FieldOffset(0)] public long CategoryIndicator;
}
Regards,
Aravind C
"Ali" <mo*********@yahoo.com> wrote in message
news:6D**********************************@microsof t.com...
Hi,
I'm a new programmer in C# but I know C/C++ programing,
I need somthing like 'union' in C#, what can I do?
thanks Ali