fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int i = 8;
  6. double d1 = i;
  7. double d2 = static_cast<double>(i);
  8. std::cout <<std::fixed << "i = " << i << ", d1 = " << d1 << ", d2 = " << d2 << std::endl;
  9. return 0;
  10. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
i = 8, d1 = 8.000000, d2 = 8.000000