fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. uint64_t port = 18196;
  8. cout << ntohs(port) << endl;
  9. cout << htons(port) << endl;
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0.01s 5456KB
stdin
Standard input is empty
stdout
5191
5191