fork download
  1. #include <cstdio>
  2. #include <string>
  3.  
  4. class Yoba {
  5. public:
  6. Yoba() : a{ 1 }, b{ 2.3 }, c{ 0 } {};
  7.  
  8. private:
  9. int a;
  10. double b;
  11. char c[20];
  12. };
  13.  
  14.  
  15. int main()
  16. {
  17. char* myobj = new char[ 1 + sizeof(Yoba) ]{ 0 };
  18. Yoba* yoba = new(myobj) Yoba{};
  19. for (auto i = 0; i <= sizeof(Yoba); ++i)
  20. {
  21. std::putc(myobj[ i ], stdout);
  22. }
  23. delete[] myobj;
  24. return 0;
  25. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
ffffff@