From the course: Code Clinic: C

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Observations and improvements

Observations and improvements - C Tutorial

From the course: Code Clinic: C

Start my 1-month free trial

Observations and improvements

- [Instructor] I'm happy that the internet doesn't assign IP addresses based on location so my solution here isn't solid in that I avoid accessing any GPS hardware that will report an accurate result after all if someone runs this code on a main frame which they could, supposing that a GPS radio is present or even necessary on such a device is really quite a stretch what I obsessed over most was how to get the radius correct. At home I looked up the coordinates reported on Google Earth and measured the distances. Here you see a screenshot of the three locations. Two of the coordinates shown at the bottom are very close, a third is 7.4 kilometers away from the other two. On that computer the program reported accuracy within a radius of about two and a quarter kilometers. Obviously if I were sending a rocket to Mars I'd be concerned about my results here. Still with two of the coordinates close together and the third 7.3 kilometers away at least according to Google Earth I'm good with…

Contents