So I have the following code:
uint32_t length = 1;
uint8_t buffer[5];
buffer[0] = htonl(length);
std::cout << (uint32_t)*buffer << std::endl;
std::cout << htonl(length) << std::endl;
The second to last line prints out 0, the last line prints out 16777216.....why....?