|
-
January 2nd, 2007, 08:33 AM
#1
getline HELP pls
class details{
public:
char name[50];
char kind;
char carid[10];
char adress[20];
char date[8];
int cost;
};
void addcustomer(){
cout<<"Write name:";
cin.getline(park[carindex].name,50);
cout<<"Give the kind of membership(Press 't' for pre-paid memberships and 'n' for non pre-paid:";
cin>>park[carindex].kind;
cout<<"Arrival date(dd/mm/yy):";
cin>>park[carindex].date;
cout<<"Write car id:";
cin>>park[carindex].carid;
cout<<"Write the adress:";
cin.getline(park[carindex].adress,50);
carindex++;
}
When i try to run the addcustomer function then the compiler doesnt allow me to "Write name:" and it skips that stage, also the same with the adress. Is something go wrong with getline()?.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|