exception - System.NullReferenceException C# advice? -
I'm getting an exception when I'm trying to run my program .. I think it's well But I'm not seeing anything like this.
Public Cord LettlandUtmxY (Double Latitude, Double Lan) {Coord co = new Coord (); Co.zone = Math.Floor ((lon + 180.0) / 6) + 1; // double field = math Floor ((LAN + 180.0) / 6) + 1; MapLatLonToXY (Digotrade (latitude), Digotrade (loan), UTMTTrerel Meridien (Ko.John), K. Eusternt); / * Adjust the fulfillment and answer for the UTM system * / Co.eastNorth [0] = cum. Authorized [0] * UTMSCalactactor + 500000.0; Co.eastNorth [1] = co. Well, North [1] * UTM Cachefactor; If (co. East north [1] & lt; 0.0) co.eastNorth [1] = Ko.Austerson [1] + 10000000.0; Return cum; }
I'm getting exceptions here ...
Public Zero MapLatLonToXY (double FI, double lambda, double lambda 0, double [] xy) {// Exception for some previous code / xy [0] ....! Xy [0] = N * Math COS (FIE) * L + (N / 6.0 * Math Po (MathCoos (FI), 3.0) * L3 Couch * Math. Pov (L, 3.0)) + (N / 120.0 * Maths. COS (FI), 5.0) * l5coef * Math. Pov (L, 5.0)) + (N / 5040.0 * Math. Pov (Math. Cos, 7.0) * l7coef * Monastery (Po, L, 7.0)) ; / * Answer calculation (y) * / xy [1] = Arch Langforf Meridien (FIFA) + (T / 2.0 * N * Monastery Po (Math. Cos (FI), 2.0) * Monastery Po (L, 2.0 ) + (T / 24.0 * N * Math.Po (MathCoos (FI), 4.0) * L4Coof * Math.Pov (L, 4.0) + + (T / 720.0 * N * Math.poO (Math) · Cos (fi), 6.0) * l6coef * Math.Pow (L, 6.0)) + (T / 40320.0 * N * Monastery Po (Math Cos (FI), 8.0) * L8 Couch * Math. L, 8.0)); Return; }
This is a composition for co
public structures cord {public double area; Public Double [] East North; }
What am I missing here?
Thanks
This is happening because xy
In your function the array (which starts with Coord.EastNorth
) is not started. I came to know that Coord was a structure and there was no class .. is there any special reason? This would work if Coord was a class
Comments
Post a Comment