How to cancel std::hex to change back to decimal type in C++

1 Answer

0 votes
#include <iostream>

int main() {
    unsigned int n = 2478821335;

    std::cout << "Integer hex value: " << std::hex << n << "\n";
    std::cout << "Integer hex value: " << n << "\n";
    std::cout << "Integer value: " << std::dec << n << "\n";
    std::cout << "Integer value: " << n << "\n";

}

/*
run:
 
Integer hex value: 93bfcfd7
Integer hex value: 93bfcfd7
Integer value: 2478821335
Integer value: 2478821335
 
*/
  

 



answered Jul 28, 2024 by avibootz
...