fork download
  1. #include <iostream>
  2. #include <arpa/inet.h>
  3.  
  4.  
  5. int main() {
  6. auto addr = inet_addr("192.168.33.115");
  7. std::cout << std::hex << addr << std::endl;
  8.  
  9. for (int i=0; i < 4; ++i)
  10. std::cout << std::dec << (addr>>(8*i)&0xFF) << ' ';
  11. }
  12.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
7321a8c0
192 168 33 115