N00B. I'm trying to feed an IP into a function and return it's host name. I'm using this website's manual but cannot figure out how to feed the actual IP inside the function. Anybody can help? I'm using gcc in Linux (Debian).

getnameinfo(3) - Linux man page

Code:
#include <stdio.h>
#include <netdb.h>
#include <sys/socket.h>

char *GETHOST(char *IP)
{
	struct sockaddr *sa;
	static char HOST[NI_MAXHOST];
	char SERVICE[NI_MAXSERV];

	getnameinfo(sa, sizeof(sa), HOST, sizeof(HOST), SERVICE, sizeof(SERVICE), NI_NAMEREQD);

	return HOST;
}

int main(void)
{
	printf("%s",GETHOST("209.85.227.105")); // Testing on Google's IP.

	return 0;
}