C
Charles
Is it possible to get a hex formatted value of 0 to output with the
base as 0x0?
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
cout << "dec 0 = " << 0 << endl;
cout << "dec 1 = " << 1 << endl;
cout << "hex 0x0 = " << hex << showbase << 0 << endl;
cout << "hex 0x1 = " << hex << showbase << 1 << endl;
return 0;
}
Thank you for responding to my painfully simple question.
Charles
Here is the same output for vc++ and g++ :
dec 0 = 0
dec 1 = 1
hex 0x0 = 0
hex 0x1 = 0x1
base as 0x0?
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
cout << "dec 0 = " << 0 << endl;
cout << "dec 1 = " << 1 << endl;
cout << "hex 0x0 = " << hex << showbase << 0 << endl;
cout << "hex 0x1 = " << hex << showbase << 1 << endl;
return 0;
}
Thank you for responding to my painfully simple question.
Charles
Here is the same output for vc++ and g++ :
dec 0 = 0
dec 1 = 1
hex 0x0 = 0
hex 0x1 = 0x1