i ran the program thru a console debug...
and if i changed the
(KElist+i) to (KElist+(i*k)) where k = sizeof (coord)
it works.
But got a problem in line 24.
the data in my heightfile is like this:
103.749 1.36522 26
103.759 1.36661 125
103.769 1.368 37
103.779 1.36939 51
103.789 1.37078 42
103.799 1.37218 53
103.809 1.37357 42
103.819 1.37496 42
103.829 1.37635 37
103.839 1.37774 32
but after reading line6, the filepointer looks like it has stopped moving and i keep getting constant values and never the EOF bit. thus resulting in a infinite loop... im baffled....
I keep getting _long = 103.809 _lat = 1.00000 _height = 53
purpose of this code is to get the 1st line of data from HeightFile, den all the entries in the LOSFile and then the last entry from HeightFile...
I'm not sure how big the new coord []; array would be without specifying the length, I've never tried it. I suspect your problem is something to do with this but I haven't quite got a handle on it yet.
EDIT: I suspect you are going off the end, and overwriting something else. I think you need to do a linked list for this, or malloc/realloc or an STL container.