My first question is: why bother? Unless there's a trick that's slipped my mind, you need to copy the value into a string and then remove the first character:
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
double f = 0.123;
ostringstream sout;
sout<< f;
string s = sout.str();
cout<< s.substr(1, s.length()) <<endl;
}
That's hardly worth the effort for something so small as removing a 0 for no apparent benefit.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004