fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. auto j = ntohs(58884);
  8. cout << j << endl;
  9.  
  10. auto i = htons(27015);
  11. cout << i << endl;
  12.  
  13. auto k = htons(i);
  14. cout << k << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
1254
34665
27015