3 ms·
Thanks. I just came across the man page myself while I was writing this tiny program. $ cat 127.1.c #include <stdio.h> #include <arpa/inet.h> int m
by sigjuice 9y ago
Thanks. I just came across the man page myself while I was writing this tiny program.
$ cat 127.1.c
#include <stdio.h>
#include <arpa/inet.h>
int main(int argc, char *argv[])
{
struct in_addr addr;
if (inet_aton(argv[1], &addr))
printf("%08x\n", addr.s_addr);
return 0;
}
$ make 127.1 CFLAGS=-Wall
cc -Wall 127.1.c -o 127.1
$ ./127.1 1.1
01000001
$ ./127.1 127.1
0100007f