C++ Tutorial/Development/input manipulator
Create an input manipulator
#include <iostream>
#include <iomanip>
using namespace std;
istream &customMessage(istream &stream)
{
cin >> hex;
cout << "Enter number using hex format: ";
return stream;
}
int main()
{
int i;
cin >> customMessage >> i;
cout << i;
return 0;
}
Enter number using hex format: 0Xaa 170