For example if we have something like this in the code
int height;
cin >> height;
user inputs
5'9
How would I go about making that work?
It would be easy enough to have
cin >> feet;
cin >> inches;
cout << feet << "'" << inches << "\n\n";
and put it together but it's just not that neat or practical of a program for the end user.
How would I be able to make it so the user can type 5'9 with the apostrophe, and still have the code understand it and use it?
Essentially what I would need it to understand is that the 5 represents 12*5 (12 inches in a foot) + the 9.
Thank you in advance!