I\'m trying to obtain my local (not the external) IP address using the getaddrinfo() function, but I saw the examples provided here, and they where too complex for my needs.
Pass the hostname after using gethostname(), to gethostbyname()
gethostname()
gethostbyname()
int gethostname(char *hostname, size_t size);