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

public sector condor (Public area area) public list & lieutenant; Double & gt; East north Set;} public cord (ex) = new list & lt; Double & gt; ();}} Public list & lieutenant; Double & gt; Map Latonotoxie (double FI, double lamp, double lambda 0) {var xy = new list & lt; Double & gt; (); // xy for xis [0] .... .... xy.Add (N * Math.Cos (phi)) * L + (N / 6.0 * Math. Pov (Math Cos (FI), 3.0 ) * L3 Coif * Math. Pov (L, 3.0)) + (N / 120.0 * Math Po (Math Cos (Fi), 5.0) * l5coef * Math.p. (L, 5.0)) + (N / 5040.0 * Math.Po (Math Cos (Fi), 7.0) * l7coef * Math.p. (L, 7.0)); / * Answer the answer (y) * / Xy.Add (ArcLengthOfMeridian (PHI) + (T / 2.0 * N * Math.Pow (Math.Cos (phi), 2.0) * Math. Pov (L, 2.0)) + (T / 24.0 * N * Math Pau (Math Cos (FI), 4.0) * l4coef * Math. Pov (L, 4.0)) + (T / 720.0 * N * Math. Pov (Math Cos (Fi) , 6.0) * L6 Coif * Monastery (L, 6.0) + + (T / 40320.0 * N * Monastery Po (Math Cos (FI), 8.0) * L8 Couch * Meth. Pov (L, 8.0) )); Return xy; } Public Cord LatLonToUTMXY (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; Cum East Noth = Maplat Lantoxi (Degotrod (Latitude), Digotrade (Lone), UTMTTrerel Meridien (Ko.John)); / * Adjust the fulfillment and answer for the UTM system * / co. Eastern [0] = cum. Eastern [0] * UTMSKeyke Factor + 500000.0; Cum East North [1] = cum. East North [1] * UTM Cachefactor; If (cum. Eastern [1] & lt; 0.0) co. Eastern [1] = cum. East North [1] + 10000000.0; Return cum; }

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -