Re: Reading Car Models


[ Follow Ups ] [ Post Followup ] [ CS1044 Web Discussion Board ] [ FAQ ]

Posted by Nit on November 13, 2001 at 05:06:13:

In Reply to: Reading Car Models posted by Josh on November 13, 2001 at 02:59:44:

: How can you read car models if they have more than one name such as "Grand Am" or "PT Cruiser"? I can only get it to read Grand, or PT, and this then messes up my program. Can anyone help me out?


Well, if you are doing a cin >> , then you will only got Grand and not Grand Am. What you are going to have to do is use the getline function.

getline(stream, variable, stopchar);

so you can do a
getline(streamname, variable, '\t');

so that it will stop at the tab instead of stopping just at white space. If you use the cin, it stops reading right when it hits white space.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS1044 Web Discussion Board ] [ FAQ ]