remove/ignore getline

How do i remove/ignore the "Choice" when user key in "Choice A" or "Choice B"

char num[50];
cout<<"Enter choice a or b";
cin.getline(num,50,'choice');
If you dont need "choice" dont ask user to enter choice just have them enter 'A' or 'B' I did not get why you want to read "choice A" and then get rid of "choice" from it

Also, cin.getline(num,50,'choice'); doesnt look right, the third (optical) parameter is a single char. You have passed a string encased in single quotes, this is not going to work
is there an example for me to read up? or which aspect shd i go?
for getline you can read http://www.cplusplus.com/reference/iostream/istream/getline/

basically cin.getline(num,50); will suffice
Rest is fine, just add a switch-case, for this look at http://www.cplusplus.com/doc/tutorial/control/ (for switch scroll down a bit)
Topic archived. No new replies allowed.