fork download
  1. #include <iostream>
  2. #include <memory.h>
  3. using namespace std;
  4.  
  5. class Foo {
  6. public:
  7. static void GetIp(uint8_t* data) {
  8. memcpy(data, &Target::IP[0], 4);
  9. };
  10. private:
  11. class Target {
  12. public:
  13. static constexpr uint8_t IP[4] = { 192,168,0,110 };
  14. static constexpr uint16_t Port = 3000;
  15. };
  16. };
  17.  
  18. constexpr uint8_t Foo::Target::IP[4];
  19.  
  20. int main()
  21. {
  22. uint8_t A[4];
  23. Foo::GetIp(A);
  24. printf("%u.%u.%u.%u", A[0], A[1], A[2], A[3]);
  25. system("PAUSE");
  26. return 0;
  27. }
  28.  
Success #stdin #stdout #stderr 0s 4560KB
stdin
Standard input is empty
stdout
192.168.0.110
stderr
sh: 1: PAUSE: not found