fork download
  1. #include <iostream>
  2. #include <netinet/in.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. //auto i = ntohl(0x00499ca1);
  8. //cout << i << endl;
  9.  
  10. unsigned char data[4] = { 0x07, 0x5B, 0xcd, 0x15 };
  11.  
  12. //uint32_t* d = reinterpret_cast<uint32_t*>(*data);
  13. //int32_t data[1] = {0x00016ed8};
  14.  
  15.  
  16. auto p = ntohl( *data );
  17.  
  18. cout << p;
  19.  
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
117440512