fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. auto i = 0xafe9120;
  8. cout << i << endl;
  9.  
  10. i = ntohl(0xafe9120);
  11. cout << i << endl;
  12.  
  13. i = htonl(0xafe9120);
  14. cout << i << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5452KB
stdin
Standard input is empty
stdout
184455456
546438666
546438666