Learn how the he process for obtaining the device's location involves visiting three websites that provide geolocation data based on a device's public IP address. Each site offers an API that outputs geolocation and other data in either CSV or JSON format. To calculate the distance between varying locations, latitude and longitude coordinates must be set.
I suppose in the trendier,…more popular programming languages,…a function or method is available to grab…a device's exact location on planet earth.…In those digital tongues,…the solution for this challenge would be three lines long…if that.…Such convenience is impossible at C, which…made this particular puzzle most challenging.…Further, I wanted to ensure that the code would run…on any platform.…So, its in text mode obviously…that it also relies upon the device's public IP address.…
From that address, I would query…at least three online databases…that associate geolocation data…with an IP address.…That result will give me a best guess location.…But its still inaccurate as an IP address…isn't location sensitive…and definitely not static.…Because the code is just querying IP addresses.…It really isn't a geolocation program in C…as much as it's a C implementation of multiple curl strips.…Curls a command line tool that fetches data…from webpage addresses.…
So I knew that once I found the IP addresses…to provide location data, I'd just be reading…
Skill Level Intermediate
1. Summarize the Weather
2. Geolocation with C
3. Eight Queens with C
4. Build a Musical Instrument with C
5. Face Recognition with C
6. Web Dashboards with C
Next steps1m 2s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.