title: Converting substrings from an input file to a double value?
body: <pre><code>void getBaseCoord(string droneInfo, double&amp; x, double&amp; y, double&amp; z){
     // x= stod(droneInfo.substr(31, 3));
      //y= stod(droneInfo.substr(34, 3));
     // z= stod(droneInfo.substr(37, 3));
      string strx, stry, strz;
      strx = droneInfo.substr(31, 3);
      stry = droneInfo.substr(34, 3);
      strz = droneInfo.substr(37,3);
      x = stof(strx);
      y = stof(stry);
      z = stof(strz);
  </code></pre>
  
  <p>The above is an excerpt from a project I'm working on currently for a novice c++ course. I am reading this string from an input file:</p>
  
  <pre><code>9673767892DroaninAlong4880021DO4.37.33.88.19.33.8U
  </code></pre>
  
  <p>The commented out part was an attempt to convert the substrings from the string line into a double value, for the purpose of the function operations. However, I am unable to convert these in this manner, and I get an error upon compilation, saying <code>stod</code> is not declared (I guess it thinks it's a variable?) </p>
  
  <p>What is the proper way to convert substrings into double values within a function?</p>