title: C++ 'stod()' not working, and 'strtod()' is throwing an error during compilation
body: <p>So I am still new to C++ and I wanted to see if I could print a result based on user input using the code below.</p>
  
  <p>The Code:</p>
  
  <pre><code>/* Input Example */
  // Initialization
  // Euler's Constant
  double eulersConstant = rand();
  
  // Euler's Guess
  string eulersGuess;
  // Euler's Guess (Double)
  double eulersGuessDouble;
  
  // Print
  cout &lt;&lt; "What is Euler's Constant?";
  
  // Input
  getline(cin, eulersGuess);
  
  // Update &gt; Euler's Guess (Double)
  eulersGuessDouble = strtod(eulersGuess);
  
  /* Logic
     If
     Euler's Guess (Double) is Euler's Constant.
     &gt; Print
  */
  if (eulersGuessDouble == eulersConstant)
     cout &lt;&lt; "\tYour guess was right! -- 'Outstanding'" &lt;&lt; endl;
  
  else
     cout &lt;&lt; "\tYour guess was wrong! -- 'One in a million chance there...'" &lt;&lt; endl;
  </code></pre>
  
  <p>When I compile this using <code>g++</code> from Windows command prompt, I get this error:</p>
  
  <blockquote>
  <pre><code>Learning C.cpp:116:47: error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string&lt;char&gt;}' to 'const char*' for argument '1' to 'double strtod(const char*, char**)'
       eulersGuessDouble = strtod(eulersGuess);
                                             ^
  </code></pre>
  </blockquote>
  
  <p>And of course, all this code is within the <code>int main()</code> function.
  I think the problem might be originating from the <code>strtod()</code> function but any help on this would be appreciated, thanks.</p>