How to parse a char array into a double
<p>Here is my question, I created char temp[100] to store the numbers in a file, the <code>temp_i</code> is the index of current position(the numbers has <code>temp_i</code> digits)</p>

<p>How to convert the char array temp from 0 to <code>temp_i</code> into the <code>value</code> I created?</p>

<p>Can any body help me?</p>

<pre><code>stack&lt;int&gt; first;
char temp[10]={'0','0','0','0','0','0','0','0','0','0'};
int temp_i = 0;
bool isDouble = false;
for(int index = 0; index&lt; strlen(str); index++){
    if(str[index] != ' '){
      temp[temp_i++] = str[index];
    } 
    else if(str[index] == '.') {
      isDouble = true;
     } else {
       double value = *(double*)temp;
       cout&lt;&lt;value&lt;&lt;endl;
       first.push(value);
      }
}
</code></pre>
