To output in hexadecimal : cout dec oct hex « Development « C++ Tutorial






#include <iostream>
using namespace std;
   
int main()
{
  cout.setf(ios::hex, ios::basefield);
   
  cout << 100; // this displays 64
   
  return 0;
}








5.4.cout dec oct hex
5.4.1.cout: hex
5.4.2.cout: oct
5.4.3.cout: dec
5.4.4.To output in hexadecimal
5.4.5.Using hex, oct, dec and setbase stream manipulators.