All pastes #578888 Raw Edit

Something

public text v1 · immutable
·published 2007-06-20 12:47 UTC
rendered paste body
int main(void){

        struct in_addr in;
        struct host_struct hs;

        hs.h_addr_list = malloc(sizeof(char *) * 10);           //ten IP addreses
        hs.h_addr_list[0] = "127.0.0.1";                        //the first of which is localhost

        inet_aton(hs.h_addr_list[0], (struct in_addr *)&in);

        printf("IP: %s in hex is: %X\n", hs.h_addr_list[0], in.s_addr);

        return 0;

}