请教字节序转换函数的问题:htonl, ntohl, htons, ntohs
htonl, ntohl, htons, ntohs:这四个函数是否只是把字节序进行颠倒(连续执行两次同样的函数,字节序是否 不变),还是会因为平台不同,函数的实现也不同?
如htonl与ntohl的功能是否是一样的?
ntohl的MSDN说:The ntohl function always returns a value in host byte order. If the netlong parameter was already in host byte order, then no operation is performed. 实际用的时候只起到颠倒字节序的作用,并没像说明中的那样