fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. auto i = ntohl(0x00000036);
  8. cout << i << endl;
  9.  
  10. i = ntohl(0x36000000);
  11. cout << i << endl;
  12.  
  13. i = ntohl(0x00003600);
  14. cout << i << endl;
  15.  
  16. i = ntohs(0x00000036);
  17. cout << i << endl;
  18.  
  19. i = ntohs(0x36000000);
  20. cout << i << endl;
  21.  
  22. i = ntohs(0x00003600);
  23. cout << i << endl;
  24.  
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
905969664
54
3538944
13824
0
54