fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double x=2.589594838;
  6. long cast = (long)x;
  7. long ref = *(long*)&x;
  8.  
  9. cout << "Cast: " << cast << endl << "Ref: " << ref << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Cast: 2
Ref: 2140720552