title: Using string from a file in a function
body: <p>I have this function in c++</p>
  
  <pre><code>double f_x(double y , string sfy )
  {
    return sfy;
  }
  </code></pre>
  
  <ol>
  <li>I want to read the string sfy from a file and pass it to the f_x function.</li>
  <li>sfy contains something like y or cos(y) or exp(y).</li>
  <li>when I pass y and sfy to the f_x, I want f_x calculates sfy and return it.</li>
  </ol>
  
  <p>I can do number 1 and 3 but the problem is that the type of f_x is double and sfy is string, so I get error.</p>
  
  <p>I can not change the type of f_x to anything else it should be double or float.</p>
  
  <p>How can I overcome this problem namely what should I do in order to f_x returns sfy as double.</p>