public struct TestStruct
{
public int i;
public double d;
};
public class cTmp
{
static unsafe void Main(string[] args)
{
TestStruct s;
// this may need to be in a fixed() {} block if you allocate
// s with new() since the CLR can move items around in memory
TestStruct* pointer = &s;
int i = (int)pointer;
Console.WriteLine(i);
}
}