I have a code that looks like the following
#include <iostream>
#include <sstream>
using namespace std;
int main(){
string s = "-1.42-14";
stringstream ss;
ss << s;
double a ;
ss >> a;
cout << "a = " << a << endl;
}
I run this code and I get a = -1.42
,but I want a = -1.42e-14
.
what should I do