I want to convert the string into a float array
They are saved as double strings
Thanks for your help
string str ="7.13566982194977e-15,1.639519203260036e-43,4.149314136725479e-8,7.987401246651457e-44,7.11674964700695e-15,1.639519203260036e-43,4.515206005147025e+27"
std::vector<float> result
>Solution :
std::istringstream(str); // #include <sstream>
std::string s;
std::vector<float> result;
while (std::getline(str, s, ','))
{
float f = atof(s.c_str());
result.push_back(f);
}