how to get ip address of iphone programmatically [duplicate]
#include <ifaddrs.h> #include <arpa/inet.h> // Get the INTERNAL ip address – (NSString *)getIPAddress { NSString *address = @”error”; struct ifaddrs *interfaces = NULL; struct ifaddrs *temp_addr = NULL; int success = 0; // retrieve the current interfaces – returns 0 on success success = getifaddrs(&interfaces); if (success == 0) { // Loop through linked list …