Error: invalid cast from string to double. How do I cast from string to double?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/392981/how-can-i-convert-string-to-double-in-c">How can I convert string to double in C++?</a>  </p>
</blockquote>



<p>how can I cast string to double in c++?</p>

<p>I have a string vector with numbers in it and i want to copy it into a vector of type double</p>

<pre><code>while (cin &gt;&gt; sample_string)
    {
        vector_string.push_back(sample_string);
    }

    for(int i = 0; i &lt;= vector_string.size(); i++)
    {
        if(i != 0 &amp;&amp; i != 2 &amp;&amp; i != vector_string.size()-1)
            vector_double.push_back((double)vector_string[i]);
    }
</code></pre>

<p><strong>edit: i cant use BOOST</strong></p>
