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

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

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

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

	return HOST;

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

	return 0;