[cs23021-2] lab7 question

Mikhail Nesterenko mikhail at cs.kent.edu
Fri Oct 16 22:24:03 EDT 2009


> when I tried to enter the streetname, ex: "hill st". The space
> between make "st" into the next string which is city, string streetname only
> take "hill" part only, then it just skip user input for city and go to next
> one. I found out only problem if I enter any space between, this will
> happen. 

this is the expected behavior of extraction operator: the input is
divided into whitespace separated tokens and assigned to input
variable sequentially.

> What can I do to make the string take the whole street name?

Use two strings for the street name. For the lab, it is assumed that
the street name always has exactly two words.

Thanks,
-- 
Mikhail


More information about the cs23021-2 mailing list