#include <sys/types.h> #include <stdio.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> main() { char buf[] = { 0xC2, 0x48, 0xA4, 0x47}; struct in_addr ipaddr; char *rfc1006; memcpy(&ipaddr, buf, sizeof(struct in_addr)); rfc1006 = inet_ntoa(ipaddr); printf("Address is : %s\n", rfc1006); }
*** This bug has been marked as a duplicate of 19428 ***