[英]Why is s_addr within in_addr an unsigned long instead of a mere unsigned if ip's are 4 octets?
Is it for ipv6? 是ipv6吗? If ipv4 is s_addr just the dotted quad reinterpreted as a 32 bit integer?
如果ipv4是s_addr,那么只是将虚线四边形重新解释为32位整数?
unsgined long
guarantees that the size of the variable is at least 4 bytes, thus holding the entire ip. unsgined long
保证变量的大小至少为4个字节,从而保存整个ip。 An unsigned int can be smaller. unsigned int可以更小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.