#include <stdio.h>
void get_ip_address(unsigned char bytes[], unsigned int ip) {
bytes[0] = ip & 0xFF;
bytes[1] = (ip >> 8) & 0xFF;
bytes[2] = (ip >> 16) & 0xFF;
bytes[3] = (ip >> 24) & 0xFF;
}
int main()
{
unsigned int ip = 2912054386;
unsigned char bytes[4];
get_ip_address(bytes, ip);
printf("The IP address is %d.%d.%d.%d\n", bytes[0], bytes[1], bytes[2], bytes[3]);
return 0;
}
/*
run:
The IP address is 114.108.146.173
*/