1 #include
2 #include
3 #include
4
5 void main()
6 {
7 uint32_t t32 = 0x0000000F;
8 struct sockaddr_in sS;
9 sS.sin_port=10;
10 sS.sin_addr.s_addr=t32;
11 char str[100];
12 inet_ntop(AF_INET,(void *)&sS,str,INET_ADDRSTRLEN);
13 printf("%s\n",str);
14 }
结果:0.0.10.0