Thank-you @Ryoucplus.
Your answer to Q4 claims that
array[i][j]
is the data from the jth column of the ith row; i.e. for the ith row,
array[i][0] is LATITUDE, array[i][1] is LONGITUDE, array[i][2] is HEIGHT
and i goes from 0 to 36251. i.e. you have a 36252 x 3 array. (Fundamentally, this is a 1-d array with 3 data elements at each position).
This is fine, except for two things:
- You already have this information in the previous examples of code and if it were correct there would be no need for anything new.
With vector<Item> v you already have precisely the same information (plus, optionally, a lot more)
v[i].latitude is LATITUDE, v[i].longitude is LONGITUDE, v[i].height is HEIGHT
- One of your other posts (reading hard between the lines) suggests that you wish to do interpolation - probably of HEIGHT across a latitude/longitude grid. In that case, I would expect array[i][j] to contain the HEIGHT at the ith latitude and jth longitude values. This is NOT what you have specified in your answers, nor does it correspond to the datasets that you have included in THIS thread. It is simply not how your data is laid out in THIS thread. However, it is ALMOST how data was laid out in one of your different threads:
http://www.cplusplus.com/forum/beginner/223585/#msg1024330
except that there you had two extra columns at the front. Most importantly, you can see a sequence of EQUAL LONGITUDE VALUES in that thread - laid out nicely for subsequent interpolation if there is a constant repeat length for LATITUDE.
So, I'm trying not to "make you sad". I'm asking you to go back, look at my questions again, and above all, supply us with a dataset that is consistent and fixed and corresponds with what you are seeking to do.
Moreover, I really suspect that
array[i][j] contains the HEIGHT at the ith LATITUDE and jth LONGITUDE of a geometrically regular array ... NOT the jth column of the ith row as you have stated. I wish you to go back and rethink this.
Supply us with a correct data set.
Have another look at what you mean by array[i][j].