fork(6) download
  1. #include <iostream>
  2.  
  3. int main() {
  4. int number = 0x3FF;
  5. std::cout << "Dec: " << number << '\n';
  6. std::cout.setf(std::ios::hex, std::ios::basefield);
  7. std::cout << "Hex: " << number << '\n';
  8.  
  9. std::cout.setf(std::ios::dec);
  10. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Dec: 1023
Hex: 3ff