help with this homework problem

Consider the statements below.

int A, B;
char C, D;
cin >> C >> A;

Before the read, the input buffer contains: A73-14

After the read, the buffer contains ___________ .

I answered A73 but it says that is wrong
First cin >> C was executed. So 'A' was read. Then cin >> A was executed. So 73 was read. As a result the buffer now contains -14
okay i get it now thanks.

any clue on this one?


Consider the code segment:

int A; string B; float C;
cin >> C >> A >> B;

If the user types: 12.345 44RB79

The value of B = _______
nobody has a clue? because i always thought int and string didnt read decimals and float could
so float would read 12.345 but then it gets to int which would land on a blank space that it could not read
Topic archived. No new replies allowed.