fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo {
  5. uint32_t ui32;
  6. float fl;
  7. };
  8.  
  9. int main() {
  10. Foo foo = {13, 42.0F};
  11. Foo* bar = reinterpret_cast<Foo*>(&foo.ui32);
  12.  
  13. cout << bar->fl << endl;
  14. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
42