I assume you want something along these lines:
#include <stdio.h>
#include <GeoIP.h>
#include <GeoIPCity.h>
int main()
{
GeoIP *gi;
GeoIPRecord *gir;
gi = GeoIP_open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_INDEX_CACHE);
if (gi == NULL) {
/* handle error */
}
gir = GeoIP_record_by_name(gi, "1.1.1.1");
if (gir == NULL) {
/* handle error */
}
printf("latitude: %f longitude: %f", gir->latitude, gir->longitude);
}