htons(), htonl(), ntohs(), ntohl()
函式原型
#include <netinet/in.h>
uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);說明
htons() host to network short
htonl() host to network long
ntohs() network to host short
ntohl() network to host long傳回值
範例
Last updated