Oct Input stream : istream « File Stream « C++ Tutorial






#include <iostream.h>
#include <iomanip.h>

istream& OctInput(istream& is);

main(void)
{
  int n;
  cin >> OctInput >> n;
  cout << "n:" << n << endl;
  cout << "hex:" <<hex<< n << endl;
  return 0;
}

istream& OctInput(istream& is)
{
  cout <<"input:";
  cin >> oct;
  return is;
}
input:12
n:10
hex:a








12.13.istream
12.13.1.Oct Input stream
12.13.2.Define your own istream type