tags:

views:

61

answers:

1

I´m not very experienced with C# but I urgently have to read a variable from a structure given in a library.

this is the definition of the structure in the library:

public struct mtLocation {
    public bool bAltitudeValid;
    public bool bCoordinatesValid;
    public double dAltitude;
    public ulong dateTime;
    public double dLatitude;
    public double dLongitude; }

I want to use write the value of dLatitude and dLongitute into my own double variables in order to use them in my program.

+6  A: 
mtLocation myLocation = new mtLocation();

...

double latitude = myLocation.dLatitude;
double longitude = myLocation.dLongitude;
womp
`long` is a reserved keyword... but I assume you already know that ;)
Bryan Menard
Haha was just editing that.
womp
You can use reserved keywords as identifiers if you prefix them with @ such as in "long @long = long.MaxValue". I never had to use this feature and I'm not sure I would really want to.
Alfred Myers