I need to get some doubles from a string.
string data = getMyData();
char** next;
double start = strtod(data.c_str(), next);
if (&data == &(*next)) //check wether a double has been found - not working
{
std::cerr << "Value can't be read.\nAborting.";
return;
}
My idea is to check for memory address of data’s first char and next.
At the moment I’m learning C++ in self education so it would be nice to get the best solution and not just a working one.
It should be:
Remember that
nextwill point to the next comma if these are comma-separated, not the beginning of the next number.