title: How to convert user input char to Double C++
body: <p>I'm trying to figure out a method of taking a user input character and converting it to a double. I've tried the <code>atof</code> function, though it appears that can only be used with constant characters. Is there a way to do this at all? Heres an idea of what I'd like to do:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(){
  
      char input;
      double result;
  
      cin &gt;&gt; input; 
  
      result = atof(input);
  }
  </code></pre>