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";
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

basically cin.getline(num,50); will suffice
Rest is fine, just add a switch-case, for this look at (for switch scroll down a bit)
Topic archived. No new replies allowed.