从结构中读取双字段

1 c# struct

我对C#不太熟悉,但我迫切需要从库中给出的结构中读取变量.

这是库中结构的定义:

public struct mtLocation {
    public bool bAltitudeValid;
    public bool bCoordinatesValid;
    public double dAltitude;
    public ulong dateTime;
    public double dLatitude;
    public double dLongitude; }
Run Code Online (Sandbox Code Playgroud)

我想使用dLatitude和dLongitute的值写入我自己的双变量,以便在我的程序中使用它们.

wom*_*omp 6

mtLocation myLocation = new mtLocation();

...

double latitude = myLocation.dLatitude;
double longitude = myLocation.dLongitude;
Run Code Online (Sandbox Code Playgroud)