/* 将十六进制表示的IP地址以标准字符串形式输出 */ #include <stdio.h> int main(void) { unsigned ip = 0x03b40c812; /* 59.64.200.18 */ printf("%8x:\t", ip); printf("%d.", (ip >> 24) & 0xff); printf("%d.", (ip >> 16) & 0xff); printf("%d.", (ip >> 8) & 0xff); printf("%d\n", ip & 0xff); return 0; }
by: 发表于:2017-08-14 11:30:17 顶(0) | 踩(0) 回复
??
回复评论