#include <iostream>
#include <arpa/inet.h>

using namespace std;

int main() {
	long l = -42;
	long l2 = ntohl(htonl(l));

	std::cout << "l2= " << l2 << std::endl;
}