title: stof function is not declared in this scope c++
body: <p>When I compile my code,I got this error</p>
  <h2>'stof' was not declared in this scope.</h2>
  <p>and my code is</p>
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string.h&gt;
  using namespace std;
  
  int main()
  {
  string str,str2;
  cin&gt;&gt;str&gt;&gt;str2;
  float a,b;
  a = stof(str);  //error
  b = stof(str2); //error
  cout&lt;&lt;a+b;
  return 0;
  }
  </code></pre>
  <p>how to resolve this ??</p>