void get_ip(char out[], unsigned int addr) { char *a = (char *) addr; sprintf(out, "%d,%d,%d,%d", a[3], a[2], a[1], a[0]); }