I'm currently trying to convert a string to a double. Right now all I'm doing is:
1 2
double f;
cin >> f;
which is great... if the user enters in a double. If the user doesn't then the program doesn't execute correctly. My question is how would I parse the double correctly? I know in Python you'd use exception handling and in vb.net/c# you'd using Double.TryParse, but I'm not sure about c++. Any help is appreciated.