How to display notational base for a number?

Well what the heck do you mean by notational base? It just means the prefix we give for hexadecimal and octal numbers. So in C++ there is an io manipulator called ‘showbase’ which shows the base and ‘noshowbase’ which hides the base from display.

An e.g. from MSDN…

[sourcecode language=’cpp’]#include

int main( )
{
   using namespace std;
   int j = 100;

   cout << showbase << j << endl;   // dec is default    cout << hex << j << showbase << endl;    cout << oct << j << showbase << endl;    cout << dec << j << noshowbase << endl;    cout << hex << j << noshowbase << endl;    cout << oct << j << noshowbase << endl; } //Output 100 0x64 0144 100 64 144[/sourcecode]

Appreciate your comments...