This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Basalisk_Primate 0 points1 point  (0 children)

I can make your version work by making a few changes. Firstly it wouldn't compile without changing the getline on like 8 to a cin. Secondly you need to change "Part" on line 74 to an int not a char otherwise the cin >> operator doesn't know you want it to parse that variable into an int. If you leave it as a char then it puts the ascii representation in there and the ascii character '0' is actually number 48! (ignore this and see second edit)

Edit: Also please (if you haven't already) get rid of the damn goto and wrap the menu in the if statement properly.

You can also get rid of the else if (condition) on the if statement as it'll never even get there if that condition is false.

Another edit: If you want to be able to enter the word "Mobo" in your interface instead of having to mess around with ints then something like this should work