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?
This is a discussion on Input problem within the C++ Programming forums, part of the General Programming Boards category; Hi guys~ I require an input that will accept a measurement in feet and pounds, i.e. 5'6 So I have ...
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; }
Last edited by C_ntua; 09-11-2008 at 03:59 AM.
SWEET.
Thanks mate~