title: Converting Input string to float/double C++
body: <p>So I know how to do it in C#, but not C++. I am trying to parse giver user input into a double (to do math with later), but I am new to C++ and am having trouble. Help?</p>
  
  <p>C#</p>
  
  <pre><code> public static class parse
          {
              public static double StringToInt(string s)
              {
                  double line = 0;
                  while (!double.TryParse(s, out line))
                  {
                      Console.WriteLine("Invalid input.");
                      Console.WriteLine("[The value you entered was not a number!]");
                      s = Console.ReadLine();
                  }
                  double x = Convert.ToDouble(s);
                  return x;
              }
          }
  </code></pre>
  
  <p>C++ 
  ?
  ?
  ?
  ?</p>