In C++ es
defines a value on the stack. In C# es
defines a reference that should be initialized with an actual object (using the new
keyword).
For initializing es
with an object (on the heap), you can change the definition to something like:
EQSTATE es = new EQSTATE();
P.S. You can define es
on the stack also in C#, by making EQSTATE
a value type (by using the struct
keyword instead of class
).