htons 和 htonl 的区别 [英] Difference between htons and htonl

查看:87
本文介绍了htons 和 htonl 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在学习简单的套接字程序时遇到了这些,我想知道 htons 和 htonl 之间有什么区别,甚至 ntohs 和ntohl.

I was learning about simple socket programs and had come across these, I wanted to know what is the difference between htons and htonl, even ntohs and ntohl.

推荐答案

htons 主机到网络短
ntohs 网络托管短
htonl 主机到网络长
ntohl 网络托管长

htons host to network short
ntohs network to host short
htonl host to network long
ntohl network to host long

long 是 32 位.short 是 16 位.

long is 32 bits. short is 16 bits.

这篇关于htons 和 htonl 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆