in_addr_t 一般为32位的unsigned int.
#define IPV4(a,b,c,d) ((a<<0)|(b<<8)|(c<<16)|(d<<24))
unsigned int value=IPV4(127,0,0,1); //这里是已逗号分开。
in_addr_t ip;
memcpy(&ip,&value,sizeof(value));
//最终显示127.0.0.1
printf(“the ip value is %s”,inet_ntoa(((struct in_addr)&ip)));