I am relatively new to C++ and would like to convert char strings of numbers to a vector of doubles. These strings will have different length, but their lengths will always be known. For example:
I have a char*
string called "myValue" which looks like this "0.5 0.4 1 5"
and has a known length, length=4
.
I would like to convert this string to a vector of doubles like this:
vector<double> Param
and give me the following output:
Param[0]=0.5, Param[1]=0.4, Param[2]=1, Param[3]=5