title: C Programming: Creating a Program to Pull Latitude and Longitude from a typedef struct
body: <p>So I have a project for my class where I need to write a program where the User will type in a City then the program will look up this city from a typedef structure then print that said city's latitude and longitude coordinates. My idea is to take the cities name as an input then somehow compare the city name with the ones in the structure (pointers maybe?) then get the latitude and the longitude when the city matches. I think that I will need to create a loop program to read the data until I find a match. Can you tell me if I am on the right track, or how you would go about writing the program? I attached a small portion of the structure (full one has 200 cities) if someone wants to try it out. </p>
  
  <pre><code>  #define MAX_CITY_LEN   35
  
     typedef struct { 
              char  name[MAX_CITY_LEN];
              float latitude;
              float longitude;
             } PLACE_T;
  
     PLACE_T places[] =
       {{"Aberdeen,Scotland",57.15,-2.15},
        {"Adelaide,Australia",-34.92,138.6},
        {"Albany,NY,USA",42.67,-73.75},
        {"Albuquerque,NM,USA",35.08,-106.65},
        {"Algiers,Algeria",36.83,3.0},
        {"Amarillo,TX,USA",35.18,-101.83},
  </code></pre>
  
  <p>Thanks, 
  Alex </p>