Possible Duplicate:
How can I convert string to double in C++?
how can I cast string to double in c++?
I have a string vector with numbers in it and i want to copy it into a vector of type double
while (cin >> sample_string)
{
vector_string.push_back(sample_string);
}
for(int i = 0; i <= vector_string.size(); i++)
{
if(i != 0 && i != 2 && i != vector_string.size()-1)
vector_double.push_back((double)vector_string[i]);
}
edit: i cant use BOOST