String Input question

Okay I am building a program that basically asks the user to build a sandwich that they would want from a menu that is displayed and output the price and such based on what they had chosen. Instead of building a weird looking menu that has lets say numbers 1-30 and have a switch statement for each. I would rather build a more appealing menu to display and just have the use pick what they would like.

Basically I want the user to input something like: {turkey, american cheese, mayo ,lettuce} as one line of code but read each of those as a separate string so I can pass them to a function and then have if-else statements checking the strings and so forth.

Any help is appreciated, also if someone has another way of checking the strings instead of if-else statements I am all ears.
1) use getline to get the entire section of user input into one string

2) split the string into multiple strings by searching for commas

3) ???

4) profit!
Topic archived. No new replies allowed.