反正短时间内我这段代码查了2回,写了三回,而且我自己都有实现的
struct in_addr ad; char p[30] = "1.2.3.4"; char q[30]; ad.s_addr = inet_addr(p); snprintf(q, 30, "%s", inet_ntoa(ad));
32位ipv4转字符串
原文:https://www.cnblogs.com/toughcactus/p/14894660.html