Making a code to take mass in lbs or kr, height in cm of feet and inches (' and " ), age in years and sex(m or f as there is a set number of 5 and -161 respectively for the calculations.) All is well for the most part but i cannot put a space between number and the unit. For example , 222lbs or 6'0" will work but 222 lbs or 180 cm will not work due to the space. How can i correct this, ive heard getline function or something like that may work but i cannot figure out how to use it in my code. Any help to correct the problem of spaces would be appreciated.
Bill
here is the code so far
_________________________________________________________________
# include <iostream>
# include <string>
using namespace std;
int main(){
string mass,height, hFeet, hInches;
double a;
char sex;
double ma, h,s;
cout<<"Enter weight [in kg or lbs]:";
cin>> mass;
cout<< "Enter height [in cm or in ']: ";
cin>>height;
cout<<"Enter age [in years]:";
cin>>a;
cout<<" Enter sex[ m or f]:";
cin>> sex;
int posM = mass.find("lbs");
int posH= height.find("'");