Confusion in htons- little endian/ big endian?

If you want your program to be portable, then any time you send an integer greater than 1 byte in size over the network, you must first convert it to network byte order using htons or htonl and the receiving computer must convert it to host byte order using ntohs or ntohl .

If you want to send data from an x86 or amd64 machine to a machine with a PowerPC processor, in binary format you'll quickly see that your data encounters the "NUXI problem" as the different processors treat the integers differently and appear to swap the bytes. (They don't actually swap the bytes -- they just work with them in a different order.).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions