Skip to content

Instantly share code, notes, and snippets.

@hasayvaz
Created November 29, 2010 02:27
Show Gist options
  • Save hasayvaz/719522 to your computer and use it in GitHub Desktop.
Save hasayvaz/719522 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <netdb.h>
#include <arpa/inet.h>
int main(int argc, char *argv[])
{
struct hostent *h;
h = gethostbyname(argv[1]);
printf("IP AAdresi : %s\n", inet_ntoa(*((struct in_addr *)h->h_addr)));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment