|
From: Soimafreak <soi...@so...> - 2003-10-07 16:12:41
|
Hi!
im trying to get wholes trings into some varibles but i'm struggling...
the code im using (below) works fine for the first thing, works okay for the
second (differnt type of read) but then on the 2nd on the getline() it just
skips the input from user and prints that cout and the other next to each
other (in bold)
cout << "Please enter your full name : ";
cin.getline(owner, 40, '\n');
cout << "Please enter your house number : ";
cin >> houseNumber;
cout << "Please enter the name of the road you live on : ";
cin.getline(road, 30, '\n');
cout << "Please enter the town or city : ";
cin >> townOrCity;
yeah, the two lines in bold are comming out one after another only the first
appears to be working, i may be using the worng type of read, i dunno, all
i know is cin >> varible; doesn't like spaces and i found that cin.getline()
you can specify what it gets untill so any help is appreciated thanks.
Matt.
|