I have a simple program:
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
double i=0.000006;
printf("%lf\n",i);
cout <<i<<endl;
return 0;
}
the output of which is :
pearl.236> ./a.out
0.000006
6e-06
pearl.237>
How can i achieve 0.000006 using the cout too?
the actual proble i have is i am redirecting this double to a string stream and later on i am printing it on screen.i want to know how we can store the actuall double representation inside the string stream.
Stream formatting is achieved with the help of manipulators.
The manipluators to specify standard and scientific notation are
fixedandscientific.