title: How to use std::stod properly
body: <p>I am working on writing a simple linear line calculator. For example, a user can enter two equations (strings) such as y=5x+3 and y=-3x+6. The most basic feature of this calculator is that it will return the intersection point of these two lines.  </p>
  
  <p>The obstacle I can't seem to figure out is how to parse the string into two pieces of data: the slope, and the y-intercept. This is a simple calculator, so the format of both lines will be y=mx+b, however, both the slope and/or y-intercept may be non-integer numbers (i.e. floats).</p>
  
  <p>I came across a function in the string library called stod, which converts a number in a string to a numerical value (am I understanding this correctly?).</p>
  
  <p><a href="http://www.cplusplus.com/reference/string/stod/" rel="nofollow">http://www.cplusplus.com/reference/string/stod/</a></p>
  
  <p>My question is, will this function do the job? If so, how exactly do I use the "idx" parameter? I don't quite understand it.</p>
  
  <p>If this isn't going to work, how can I parse this user-entered data?</p>
  
  <ul>
  <li>both equations are strings (y=mx+b)</li>
  <li>m and b have private variables dedicated in storing the decimal value (i.e. double m_ and double b_ are private member variables)</li>
  </ul>