Hi guys~
I require an input that will accept a measurement in feet and pounds, i.e. 5'6
So I have this so far:
However, my programme is unable to read the apostrophe.Code:cout << "Enter your height: " ;
float x, y ;
cin >> x >> y;
Any hints?
Printable View
Hi guys~
I require an input that will accept a measurement in feet and pounds, i.e. 5'6
So I have this so far:
However, my programme is unable to read the apostrophe.Code:cout << "Enter your height: " ;
float x, y ;
cin >> x >> y;
Any hints?
You read two float numbers. You should read a float, a character (the apostrophe) and a float number. Try that. I guess it reads only the 5 eh?
EDIT: Some code:
Code:#include <iostream>
using namespace std;
int main(void)
{
float x, y;
char c;
cin >> x >> c >> y;
cout << x << " " << y;
}
SWEET.
Thanks mate~