> C++ How do I pull out a value in a string and store in a variable?

C++ How do I pull out a value in a string and store in a variable?

Posted at: 2014-12-18 
Use this as a reference: http://www.cplusplus.com/reference/strin...

Like if the user enters "38 F" how do I take out the 38 only and store it in a variable?

so far my program goes like this:

string text;

double temperature;

cout << "Enter temperature: ";

getline(cin, text);

// I run into a dead end at this point