Question: Host byte order in a computer system is either little endian or big endian depending on the computer architecture.
For example in Intel architecture computers the host byte order is little endian , while in Motorola computers , the host byte order is big endian.
Network byte order on the other hand is always big endian.
This is necessary to make sure the systems from different manufacturers are compatible on the network. uint32_t fromHosttoNetwork(uint32_t hostlong)
uint32_t fromNetworktoHost(uint32_t netlong) are two functions that are desired to convert from host byte order to network byte order or vice versa.
The fromHosttoNetwork () function converts the unsigned integer hostlong from host byte order to network byte order.
The fromNetworktoHost () function converts the unsigned integer netlong from network byte order to
host byte order.
Write a function fromHosttoNetwork in C that will accept an integer variable and covert it from host byte order to network byte order.
Write a function fromNetworktoHost in C that will accept an integer in network byte order and return an integer in host byte order.
You need to prepare a function which accept an integer variable and covert it from host byte order to network byte order.